Return to Snippet

Revision: 11491
at February 6, 2009 22:35 by wrburgess


Initial Code
/*********************************************
/* add this to a javascript file in the theme 
/*********************************************/

sfHover = function() {
  var sfEls = document.getElementById("nav").getElementsByTagName("li");
  
  for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
      this.className+=" sfhover";
    }
    sfEls[i].onmouseout=function() {
      this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
    }
  }
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

/*********************************************
/* import into any page template files
/*********************************************/

<script type="text/javascript" src="hover.js"></script>

/*********************************************
/* replace "footer" with id of menu wrapper 
/*********************************************/

#footer ul {
  margin: 0;  
  padding: 0;
  list-style: none;  
}

#footer a {
  display: block;
  width: 10em;
}

#footer li {
  float: left;
  width:  10em;
}

#footer li ul {
  position: absolute;
  width: 10em;
  left: -999em;
}

#footer li:hover ul {
  left: auto;
}

#footer li:hover ul, #footer li.sfhover ul {
  left:auto;
}

*:first-child+html #footer {
height: 1%;
}
*:first-child+html #footer li {
height: 1%;
}

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

Initial Description


Initial Title
Sons of Suckerfish Menu in Drupal 6

Initial Tags
css, javascript, drupal

Initial Language
CSS