Image swap
Posted: Sun Jan 20, 2008 11:36 am
I have a <td> where the main picture is displayed and on the other td's the thubnails. Now I want to change the main picture with the thubnail picture everything a different picture is clicked.
The main picture is now showing :
<img src="viewImage.php?type=glimage&name=<?php echo $image['im_image']; ?>" border=0 id="main">
now I have tried :
<a href="#" onclick="main.src='viewImage.php?type=glimage&name=<?php echo $image['im_image2']; ?>"><img src="viewImage.php?type=glimage&name=<?php echo $image['im_image2']; ?>" alt="Click to enlarge" style="border:1px solid #000000; width:70; height:53px;">
This does not change the picture in the first td.
What am i doing wrong?
Any help would be appreciated
The main picture is now showing :
<img src="viewImage.php?type=glimage&name=<?php echo $image['im_image']; ?>" border=0 id="main">
now I have tried :
<a href="#" onclick="main.src='viewImage.php?type=glimage&name=<?php echo $image['im_image2']; ?>"><img src="viewImage.php?type=glimage&name=<?php echo $image['im_image2']; ?>" alt="Click to enlarge" style="border:1px solid #000000; width:70; height:53px;">
This does not change the picture in the first td.
What am i doing wrong?
Any help would be appreciated