Suckerfish hover


/ Published in: JavaScript
Save to your folder(s)

This would make IE treat the hover element in whichever tag you implemented.


Copy this code and paste it in your HTML
  1. sfHover = function() {
  2. var sfEls = document.getElementById("nav").getElementsByTagName("LI");
  3. for (var i=0; i<sfEls.length; i++) {
  4. sfEls[i].onmouseover=function() {
  5. this.className+=" sfhover";
  6. }
  7. sfEls[i].onmouseout=function() {
  8. this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
  9. }
  10. }
  11. }
  12. if (window.attachEvent) window.attachEvent("onload", sfHover);

URL: http://www.htmldog.com/articles/suckerfish/dropdowns/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.