[thelist] JAVASCRIPT: open window based on image size

Burhan Khalid burhankhalid at members.evolt.org
Tue Jul 9 20:40:01 CDT 2002


>
>
>hi.
>
>i think i've asked this question before, but unfortunately i can't find
>an answer with google and i can't find any files on ma pc.
>
>i know i've seen this but i can't remember any websites which do this so
>i can go and steal the code.
>
>what i want to do is open a popup window that is the same size as an
>image. and be dynamic of course.
>
>if someone knows of a website that does this i can probably just go take
>a look, otherwise... i could use the help.
>
>thanks,
>chris.
>
>
Hey Chris :

I don't know if someone has answered this already, I'm recovering from a
system scrubbing, so my mails are out of sync, but....

I think you can do this with a combination of two different scripts. I
don't know JavaScript well enough to know if it can find image width and
height, but, in PHP, you can get this information very easily :

$array_size = getimagesize("locationofimage");

//$array_size[0] = width, $array_size[1] = height

You could then just plug this information into your javascript that pops
up your window.

hth,
Burhan

http://www.php.net/manual/en/function.getimagesize.php (more information
on getsize)






More information about the thelist mailing list