...

View Full Version : help.. mouseover!



zlkjd
12-08-2006, 09:18 AM
hi, i need some help. im a complete newb at this and im having some trouble with this mouseover code.
this code works fine by itself. but when i add the code to another image, it works but will change the first image's mouseover to the same as the second one, when they're supposed to be different! hope this makes sense. ive checked to make sure i havent named any of the images the same. it just seems like whichever image ive done last overwrites all the others. am i missing something?


<script language="JavaScript">
<!-- // start hidden code
our_image = new Image();
our_image.src ="img/image2.png";
// done with hidden code -->
</script>

<a href="#" onMouseOver="image1.src=our_image.src";
onMouseOut="image1.src='img/image1.png'";>
<img height="21" width="83" border="0" img name="image1" src="img/image1.png"/></a>

Goat Spirit
12-08-2006, 04:59 PM
hi, i need some help. im a complete newb at this and im having some trouble with this mouseover code.
this code works fine by itself. but when i add the code to another image, it works but will change the first image's mouseover to the same as the second one, when they're supposed to be different! hope this makes sense. ive checked to make sure i havent named any of the images the same. it just seems like whichever image ive done last overwrites all the others. am i missing something?


<script language="JavaScript">
<!-- // start hidden code
our_image = new Image();
our_image.src ="img/image2.png";
// done with hidden code -->
</script>

<a href="#" onMouseOver="image1.src=our_image.src";
onMouseOut="image1.src='img/image1.png'";>
<img height="21" width="83" border="0" name="image1" src="img/image1.png"/></a>


<!-- not sure why you had this:
<img height="21" width="83" border="0" img name="image1" src="img/image1.png"/></a>
-->
Try this, mabey it will work:


<script language="JavaScript">
<!-- // start hidden code
our_image = new Image();
our_imagetwo = new Image();
our_image.src = "img/image2.png";
our_imagetwo.src = "img/image3.png"
<!-- or be image1.png -->
// done with hidden code -->
</script>
<a href="#" onMouseOver="image1.src=our_image.src";
onMouseOut="image1.src=our_imagetwo.src";>
<img height="21" width="83" border="0" img name="image1" src="img/image1.png"/></a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum