View Single Post
Old 04-06-2004, 13:16   #1
Millay
Inactive
 
Millay's Avatar
 
Join Date: Oct 2003
Location: Portsmouth
Age: 48
Posts: 1,689
Millay has reached the bronze age
Millay has reached the bronze ageMillay has reached the bronze ageMillay has reached the bronze ageMillay has reached the bronze ageMillay has reached the bronze ageMillay has reached the bronze ageMillay has reached the bronze age
Send a message via MSN to Millay Send a message via Yahoo to Millay
Javascript and image rollovers

Hi all, im sure everyone and his cat knows how to do image rollovers, my problem is I want to dynaimcally change the name of the image I am changing, as I will be changing multiple images depending on where the users mouse is on the screen, just cant get my head around the code to make this work.. here is what i have done so far (it doesnt work).
<script=javascript>
arr_Number = ImageNumber.split("x");
document.all.xAxis.innerHTML = arr_Number[0];
document.all.yAxis.innerHTML = arr_Number[1];
ImgSourceName = "im" & arr_Number[0] & "x" & arr_Number[1]
ImgSourceName.src = "images/glassblockmouseover.jpg";
//document.write(arr_Number[0]);
//document.write(arr_Number[1]);
//alert('hello');
</script>

HTML for onew image is below.

<a href="glassinteractive.php?acc=1&down=1" onMouseOut="ImageChangerRestore()" onMouseOver="ImageChanger('1x1')"><img name="im1x1" src="images/glassblock.jpg" width="28" height="28" border="0"></a>



Hope this makes sense..
Millay is offline   Reply With Quote