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

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>
0
MulaG
Asked:
MulaG
1 Solution
 
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
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
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
 
RoonaanCommented:
When you are using xhtml, then use lowercase onmouseover and onmouseout. and put a / at the end of the image tag: />

-r-
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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