Forum Moderators: open
My goal is a css drop down menu with only the two levels. This script works on my mac (ff, ie, safari). But my client says it isn't working on his pc (ie6, I believe)
Here are the comments:
"I especially like the drop down menus.
However, they don't seem to work quite right. I move my mouse down the list and they disappear before I can click on anything. It seems to be more prevalent on the right side of the drop down list."
<script type="text/javascript"><!--//--><![CDATA[//><!--
function menuFix() {
var sfEls = document.getElementById("navdrop").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
// event added to keep menu items from disappearing
sfEls[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
// event added to keep menu items from disappearing
sfEls[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("(?¦^)sfhover\\b"), "");
}
}
}
window.onload=menuFix;
//--><!]]></script> I can load the css and html if you like.
ps - I have this code in the head of every page on the site, since if I refer to a linked js file, ie mac won't work. I will put it as a link if it will definetely work in iepc since that is the target audience.