I have written a code to enlarge an image from a thumbnail. What I am trying to do is have a series of thumbnails in one frame and enlarge the image in another frame so that the enlarged image is always in a constant position.
this is the code:
Then I display the thumbnails:Code:<style> } .thumbNormal { border:1px solid #000000; } .thumbSelected { border:1px solid #ff0000; } </style> <!-- var lastID = 0; function SelectImg(id) { if (lastID > 0) { document.getElementById(lastID).className = "thumbNormal"; } document.getElementById(id).className = "thumbSelected"; document.getElementById(0).src = document.getElementById(id).src; lastID = id; } function LoadTrigger() { SelectImg(1); } window.onload = LoadTrigger; //-->
Then display the enlarged image:Code:<table border="0" cellspacing="8" cellpadding="4" > <tr> <td><img id=1 class="thumbNormal" SRC="dogs/1.gif" WIDTH=80 HEIGHT=60 ALT="Click to Enlarge" onclick="SelectImg(1)"></td> <td><img id=2 class="thumbNormal" SRC="dogs/2.gif" WIDTH=80 HEIGHT=60 ALT="Click to Enlarge" onclick="SelectImg(2)"></td> </tr> </table>
What I want to do is the last part in a separate frame, but I dont know how to identify the image so that it is recognised in that frame. There can be up to 60 thumbnails to display.Code:<table border="0" cellspacing="8" cellpadding="8"> <tr> <td> <img id=0 src="" GALLERYIMG="no"> </td> </tr> </table>
Can anybody help?


Reply With Quote
Bookmarks