• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 593
  • Last Modified:

IE7 onmouseout background block remains

I use
<!--[if lte IE 7]>
	<script type="text/javascript">
	sfHover=function(){var sfEls=document.getElementById("navigation").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>
	<![endif]-->

Open in new window

at http://tinyurl.com/2ujswr3 to make sure the white block is hidden onmouseout. But somehow it does not seem to run in IE7 or less. As soon as I have hovered on a menu item the white background appears and does not leave. Can someone tell me why?

PS Loading it for IE6 only now, but the issue of the script not working remains the same
0
rhandalthor
Asked:
rhandalthor
  • 3
  • 3
2 Solutions
 
darren-w-Commented:
Try using jquery to do this, you won't have to worry about browser compatabily then
Darren
0
 
rhandalthorAuthor Commented:
@ Darren-w-: So why is the current JScript not running? I mean if I cannot get the current one to work how would I get http://api.jquery.com/hover/ to work?
0
 
darren-w-Commented:
hi,

have you fixed this know, just had a look and I could not see the code you are referring to?

D
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
rhandalthorAuthor Commented:
Removed it for now as there was not solution I could use just yet. IE7 works OK without it, but IE6 does not. So the issue has not been resolved yet. It just moved to IE6. Could you help me using jQuery there to make hover function?
0
 
darren-w-Commented:
Hi,

Take a look a Stu Nicholls website below, he does a very simple example of a on hover menu using just css and xhtml, this may be a simpler approach and should be compatible with all browsers :

http://www.cssplay.co.uk/menus/tutorial.html  (example 9)

Please get back to should you need further pointers.

Darren
0
 
rhandalthorAuthor Commented:
Will use this solution for IE6 and or entire menu as soon as I have time again. Thanks!
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now