Log in

View Full Version : Combine Thumbnailviewer with Thumbnailviewer2



ivan
03-16-2008, 12:37 PM
Hello,

I have 3 thumbs from the same image:
- Thumb, a image from 80*60px
- Bigthumb, a image from 250*200
- image, a image from 800*600

I want to do the following:

If you click the Thumb, Thumbnailviewer2 changes to Bigthumb, this is not any problem.

If you click on the Bigthumb it has to popup using Thumbnailviewer to image..

i did the following...

The HTML To show the images


<html>
<head>
<script>
/***********************************************
* Image Thumbnail Viewer Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript" src="thumbnailviewer2.js" defer="defer"></script>
<link rel="stylesheet" href="thumbnailviewer.css" type="text/css" />
<script src="thumbnailviewer.js" type="text/javascript"></script>
</head>
<body>
<a href="/occasions/bigthumbs/9-1.jpg" rel="enlargeimage::click" rev="loadarea::/occasions/9-3.jpg"><img src="/occasions/thumbs/9-1.jpg" border="0" width="83"></a>
<a href="/occasions/bigthumbs/9-2.jpg" rel="enlargeimage::click" rev="loadarea::/occasions/9-3.jpg"><img src="/occasions/thumbs/9-2.jpg" border="0" width="83"></a>
<a href="/occasions/bigthumbs/9-3.jpg" rel="enlargeimage::click" rev="loadarea::/occasions/9-3.jpg"><img src="/occasions/thumbs/9-3.jpg" border="0" width="83"></a>
<div id="loadarea" style="width: 250px"><a href="/occasions/9-3.jpg" rel="thumbnail"><img border="0" src="/occasions/bigthumbs/9-3.jpg" border="0" width="250" height="200"></a></div>

</body>
</html>



The Thumbnailviewer2.js line 24-26


var imageHTML='<img src="'+imagepath+'" style="border-width: 0" width="250" height="200" />' //Construct HTML for enlarged image
if (typeof dest!="undefined") //Hyperlink the enlarged image?
imageHTML='<a href="'+dest+'" rel="thumbnail" >'+imageHTML+'</a>'


What do i wrong??