What would be jQuery equivalent of this sf hover suckerfish code?

Posted by metal-gear-solid on Stack Overflow See other posts from Stack Overflow or by metal-gear-solid
Published on 2010-05-04T03:16:18Z Indexed on 2010/05/04 3:28 UTC
Read the original article Hit count: 177

Filed under:
|

What would be jQuery equivalent of this sf hover suckerfish code?

<script>
sfHover = function() {
   var sfEls = document.getElementById("navbar").getElementsByTagName("li");
   for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
         this.className+=" hover";
      }
      sfEls[i].onmouseout=function() {
         this.className=this.className.replace(new RegExp(" hover\\b"), "");
      }
   }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript