PDA

View Full Version : Thumbnail Viewer not enlarging?



rxsid
10-09-2005, 06:17 AM
Hi all,
Regarding this script:
http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm

The function in there states


function enlarge(which, e, position, imgwidth, imgheight){

yet it doesn't enlarge the image. perhaps i'm being too literal because i was hoping this awesome script would indeed actually enlarge the image. I mean, what's the point of pasing in the optional imgwidth and imgheight parms anyway?

is there a way to really enlarge the image with this script, aside from keeping two versions of the same image (one thumbnail and one 'original' size)?

Thanks.

ddadmin
10-11-2005, 12:18 AM
The "imgwidth" and "imgheight" parameters were originally designed just so the script knows how to center the image based on its dimensions. But if you want the script to also actually enlarge the image using such values, simply change:


crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><img src="'+which+'">'

to:


crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><img src="'+which+'" width="'+imgwidth+'px" height="'+imgheight+'px">'