onmouseover image does not change in IE6


This may be a simple question but could someone enlighten me as to how to change an image (menu button) in IE6? It works fine in Mozilla but nothing happens in IE. Here is the code:

<div id="welcomeMenu">
      <a href="schools/index.html"><img name="imageflip2" onMouseOver="src='Images/Menu/SchoolsOn.png'"     onMouseOut="src='Images/Menu/SchoolsOff.png'" src="Images/Menu/SchoolsOff.png" alt="" height="25" width="75" border="0"></a>

</div>
MulaGAsked:
Who is Participating?
 
nabsolCommented:
Hi

Actualy i used images of that site. icon1 and icon2 and i put those images into images/menu folder and written this code and it works. You may try this

<html>
<head>

<title>Untitled Document</title>
<SCRIPT language=javascript src="mycode.js" type=text/javascript></SCRIPT></head>

<body>
<div id="welcomeMenu">
<a href="schools/index.html">
<img name="imageflip2" onMouseOver="src='Images/Menu/icon1.gif'" onMouseOut="src='Images/Menu/icon2.gif'" src="Images/Menu/icon2.gif" alt="" height="25" width="75" border="0"></a>

</div>
</body>
</html>


By Nab
0
 
nabsolCommented:
Hi

This may elaborate more precisely than i can do here so its better go to this link to find an online tutorial.
http://www.webdevelopersnotes.com/tutorials/javascript/changing_images_on_mouseover_mouseout_javascript.php3

Thanks

By Nab
0
 
knucklesbammCommented:
Have you tried putting "this." in front of src in your attribute?

<a href="schools/index.html"><img name="imageflip2" onMouseOver="this.src='Images/Menu/SchoolsOn.png'"     onMouseOut="this.src='Images/Menu/SchoolsOff.png'" src="Images/Menu/SchoolsOff.png" alt="" height="25" width="75" border="0"></a>
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
nabsolCommented:
Hi
I think it does't metter if you write "this" or not as its already inline. There is no error in that code of MulaG. It works for ie. I used my images and checked.

By Nab
0
 
MulaGAuthor Commented:

Thanks guys but I've tried .this and it doesn't work. Also went to the tutorial link and still no joy. I'm confused as to how Nabsol got it working in IE using the same code and it fails for me? Is this anything to do with me running the webpage locally?

Cheers
MulaG
0
 
RoonaanCommented:
When you are using xhtml, then use lowercase onmouseover and onmouseout. and put a / at the end of the image tag: />

-r-
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.