...

View Full Version : son of suckerfish dropdowns



efhx
01-14-2008, 07:29 PM
I'm using the single level drop downs from here http://www.htmldog.com/articles/suckerfish/dropdowns/ but I'm not sure where exactly to put the javascript since I'm not too famililiar with it can somewhere tell me where?


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);

_Aerospace_Eng_
01-14-2008, 07:36 PM
Just put it within the <head></head> part of your document.

<script type="text/javascript">
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);
</script>
And if you took the time to view their examples as well as view their source then you would know. Sometimes the answers are staring at you right in the face.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum