Solved

IE7 onmouseout background block remains

Posted on 2010-11-13
6
560 Views
Last Modified: 2012-06-27
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
Comment
Question by:rhandalthor
  • 3
  • 3
6 Comments
 
LVL 13

Accepted Solution

by:
darren-w- earned 500 total points
Comment Utility
Try using jquery to do this, you won't have to worry about browser compatabily then
Darren
0
 

Author Comment

by:rhandalthor
Comment Utility
@ 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
 
LVL 13

Expert Comment

by:darren-w-
Comment Utility
hi,

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

D
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:rhandalthor
Comment Utility
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
 
LVL 13

Assisted Solution

by:darren-w-
darren-w- earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:rhandalthor
Comment Utility
Will use this solution for IE6 and or entire menu as soon as I have time again. Thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to count occurrences of each item in an array.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now