Forum Moderators: open

Message Too Old, No Replies

click image to change multiple others

         

gardenman

6:50 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



Imagine you have about 6 small thumbnail images of a widget, and a large image of a widget.

I need to click on a thumbnail for the large image to change showing a big version of the thumbnail you clicked on. I also need to be able to click on any of the 6 thumbnails to change the big image version of each widget.

Can anyone help me out with a pointer to code which I can copy/paste and modify to fit..?

This would really get me out of a pickle.

orhor

7:25 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



those are small ones:

<image src='small1.jpg' id='smallimage1' onClick='javascript:document.getElementById("bigImage").src="someImage1.jpg";'>
<image src='small2.jpg' id='smallimage2' onClick='javascript:document.getElementById("bigImage").src="someImage2.jpg";'>

and the large one:

<image id='bigImage'>

this has one bad thing - you must wait till the image is downloaded after clicking. if you dont want wait first load the images - put this code before <BODY> tag:
<script language="JavaScript" type="text/javascript">
<!--
big1= new Image();
big1.src="someImage1.jpg"
//-->
</script>