PDA

View Full Version : popup window size to fit image size. how?


JeroenM
11-16-2004, 06:16 PM
At this page:
http://users.pandora.be/jeroenm/index.html you can click the thumbnails and a new window opens.

I could specify the new window size to fit the pictures because they are all horizontal images.

However, when I have another group of images like at http://users.pandora.be/jeroenm/fotos_recent1.html there is a mixture of horizontal and vertical images.

So, my question is:
is it possible to specify the window size as imagewidth+10 and imageheighth+10 whereby the imagewidth and imageheighth are calculated from the image itself?
or is this simply impossible with javascript (but possible with php or a server side script) and do I need to tell the script the direction of the image?

In the second case:
I tried that but it just wouldn't work.
the code looked like this:
...
var height = 500;
var width = 500;
if (direct == horiz) (height = 300);
if (direct == vertic) (width = 300);

....

onClick .... 'thumbs/1.jpg', 'horiz')
...

any suggestions what might be my fundamentally misunderstanding or typo?

thanks

Jeroen

JeroenM
11-16-2004, 06:22 PM
I wanted to add this:
I already asked a related question. Not exactly this question but I think someone might have answered this question in that thread: http://www.htmlforums.com/showthread.php?s=&threadid=48737
but I just don't understand if it does or doesn't.
anyway, if you understand it, please tell me.