PDA

View Full Version : Javascript on Menus in IE


FabienO
09-03-2008, 03:08 PM
My website is using a suckerfish menu i modified to make it look as it is, however there's an issue. In IE if you highlite some text on the site then hover over the menus they remain dropped down.

I assume it's a javascript issue, here is the code.

<script type="text/javascript"><!--//--><![CDATA[//><!--

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>

Preview the site at http://www.fabieno.com/ (http://www.FabienO.com)

BonRouge
09-03-2008, 10:31 PM
Change the 'left' in the 'left:-999em' and 'left:auto' bits to 'margin-left'.
I'm not sure why, but this seems to fix the problem.
By the way, Edinburgh and Responsibility are spelt wrong in your menu.

FabienO
09-16-2008, 02:28 PM
Sorry for the bump, I just got out of hospital. Works great, thank you millions!.