Posted By

designerd on 10/06/06


Tagged

javascript js ie liover


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jonhenshaw
rnrleachryan


li:hover in IE


 / Published in: JavaScript
 

Lets IE set a class .over on hover as IE doesn't support li:hover

  1. startList = function() {
  2. if (document.all && document.getElementById) {
  3. navRoot = document.getElementById("dmenu");
  4. for (i=0; i < navRoot.childNodes.length; i++) {
  5. node = navRoot.childNodes[i];
  6. if (node.nodeName=="LI") {
  7. node.onmouseover=function() {
  8. this.className+=" over";
  9. }
  10. node.onmouseout=function() {
  11. this.className=this.className.replace(" over", "");
  12. }
  13. }
  14. }
  15. }
  16. }
  17.  
  18. window.onload=startList;

Report this snippet  

You need to login to post a comment.