Solved

IE7 onmouseout background block remains

Posted on 2010-11-13
6
563 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
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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 learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

803 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