:hover pseudo element

liunx

Guest
hello, currently i use the :hover pseudo element for my dropdown menu w/ a js for ie users. I was wondering if the following would be better to use than the js:
<!-- m --><a class="postlink" href="http://www.vladdy.net/Demos/iepseudoclassesfix.html">http://www.vladdy.net/Demos/iepseudoclassesfix.html</a><!-- m -->

also, what would all the advantages be to using/not using it? thx

also, the js i use is:

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;Real browsers ignore .htc so you save some bandwidth.
Your script targets a certain element, while the code I provided will work with any element on a web page and is shorter.
Your script will not work with other scripts on the page that utilize onload event.Originally posted by Vladdy
Real browsers ignore .htc so you save some bandwidth.
Your script targets a certain element, while the code I provided will work with any element on a web page and is shorter.
Your script will not work with other scripts on the page that utilize onload event.

awesome, thx for the reply. I didnt realize that it was your site at first so when you said the code you provided i was looking around for code :P lol thx for the help i really appreciate it :D
 
Back
Top