Solved

IE7 onmouseout background block remains

Posted on 2010-11-13
6
568 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 13

Accepted Solution

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

Author Comment

by:rhandalthor
ID: 34127271
@ 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-
ID: 34127824
hi,

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

D
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:rhandalthor
ID: 34130341
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
ID: 34130803
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
ID: 34161739
Will use this solution for IE6 and or entire menu as soon as I have time again. Thanks!
0

Featured Post

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

752 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