[solved]faking an href
Posted: Wed May 11, 2005 6:07 am
I am having some weird issues between mozilla browsers and ie, suprise, suprise.
What I am trying to do is to create some <a> tags that do nothing, i'm going to put an onClick event in them to set some values for a page(that part I can put in later).
The trouble is if I just define <a>some link</a> then in firefox the css for a:hover works just fine, it changes the background and text color just fine. In ie without having a href inside the <a> tag it does nothing.
below is some code that I am using(just a small sample) for you to see the what is happening between firefox and ie.
the sub menu items change just fine but the main menu items don't change at all. the only difference is the href within the <a> tags.
Any ideas how to make the href attribure do nothing or convince ie to change like I want it too.
thanks.
phpScott
What I am trying to do is to create some <a> tags that do nothing, i'm going to put an onClick event in them to set some values for a page(that part I can put in later).
The trouble is if I just define <a>some link</a> then in firefox the css for a:hover works just fine, it changes the background and text color just fine. In ie without having a href inside the <a> tag it does nothing.
below is some code that I am using(just a small sample) for you to see the what is happening between firefox and ie.
the sub menu items change just fine but the main menu items don't change at all. the only difference is the href within the <a> tags.
Any ideas how to make the href attribure do nothing or convince ie to change like I want it too.
Code: Select all
<!DOCTYPE html PUBLIC "e;-//W3C//DTD XHTML 1.0 Strict//EN"e; "e;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"e;>
<html xmlns="e;http://www.w3.org/1999/xhtml"e; xml:lang="e;en"e; lang="e;en"e;>
<head>
<title>some page</title>
<style type="e;text/css"e;>
#menuList a {
text-decoration: underline;
cursor: pointer;
}
#menuList a:visited {
text-decoration: underline;
cursor: pointer;
}
#menuList a:hover {
background-color: #FC881A;
color: #380040;
text-decoration: underline;
}
</style>
</head>
<body>
<div id="e;navigation"e;>
<ul id="e;menuList"e;>
<li>
<a>Add to Main Menu Section</a>
</li>
<li>
<a id = "e;Home"e; title = "e;Home"e;>Home</a>
</li>
<li class="e;menubar"e;>
<a id = "e;contact-actuator"e; title = "e;Contact"e; class="e;actuator"e;>Contact</a>
<ul id="e;contact-menu"e; class="e;menu2"e;>
<li>
<a href="e;_#"e; target="e;blah"e; id = "e;contact-london"e; title = "e;Contact London"e;>Contact London</a>
</li>
<li>
<a href="e;_#"e; target="e;blah"e; id = "e;chelsea-offices"e; title = "e;Chelsea Offices"e;>chelsea offices</a>
</li>
<li style="e;border-bottom: none;"e;>
<a href="e;_#"e; target="e;blah"e; id = "e;birmingham-offices"e; title = "e;Birmingham Offices"e;>Birmingham offices</a>
</li>
</ul>
</li>
<li class="e;menubar"e;>
<a href"e;javascript:alert('nothing');"e; id = "e;services-actuator"e; title = "e;Services"e; class="e;actuator"e;>Services</a>
<ul id="e;services-menu"e; class="e;menu2"e;>
<li>
<a href="e;_#"e; target="e;blah"e; id = "e;db-design"e; title = "e;DB Design"e;>DB design</a>
</li>
<li>
<a href="e;_#"e; target="e;blah"e; id = "e;graphic-design"e; title = "e;Graphic Design"e;>Graphic Design</a>
</li>
<li style="e;border-bottom: none;"e;>
<a href="e;_#"e; target="e;blah"e; id = "e;main-menu"e; title = "e;Main Menu"e;>main menu</a>
</li>
</ul>
</li>
<li>
<a id = "e;test page"e; title = "e;Test Page"e;>test page</a>
</li>
</ul>
</div>
</body>
</html>phpScott