[thelist] JAVASCRIPT: open window based on image size

Chris W. Parker cparker at swatgear.com
Wed Jul 10 13:32:01 CDT 2002


> -----Original Message-----
> From: Ken Kogler [mailto:ken.kogler at cph.org]
>
> > what i want to do is open a popup window that
> > is the same size as an image. and be
> > dynamic of course.
>
> Chris,
>
> Your question is a little unclear. Are you looking for a way
> to detect image
> height/width using javascript? Or would using ASP (which you
> mentioned in
> your response to Burhan Khalid) work for you?

i was requesting a javascript method. my mention of asp was, i think,
referring to your script(which i think i've got on my computer
somewhere). as far as i can remember the javascript version (or
versions, that i've seen) was much more simple than your function which
has to read the file and use some bit/byte fiddling to figure out the
height/width. that's not to say that you're doing it wrong, it's just
that i think javascript has a property as opposed to a fancy function.

and i think the javascript function resizes the opened window based on
the image it is displaying onload, as opposed to figuring it out ahead
of time.

> I've got an ASP function that can "figure out" the dimensions
> of an image...
> from there, it's a simple matter of writing out the javascript popup
> function:
>
> openWindow('something/else.htm','','width=<%= width
> %>height=<%= height
> %>');
>
> (that's psuedo-code, btw -- don't copy/paste it! :)

<sarcasm>oh no! is that why my hypertext marken language page that i
made with frontpage 2002 with java capabilities is not working
anymore?!? if i was uber-1337 like the rest of you gurus i would have
realized!</sarcasm>

;)

> If you want the ASP image functions, msg me offlist and I'll
> hook you up.

ok thanks.

chris.



More information about the thelist mailing list