Topic awaiting preservation: Retrieve picture size during preload. (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Belgium |
posted 01-20-2003 09:31
Hi, code: img = new Image();
|
Nervous Wreck (II) Inmate From: Utreg, NL |
posted 01-20-2003 09:56
Images have their own onload handler, so one way to do this would be to put a hidden (visibility:hidden, display:none) "buffer" image in your page, and change its source to the desired image. the img tag would have an onload handler, which is autmagically fired when the new image is loaded. The other way is to create images on the fly with dom script, and attach the onload with js. Dunno if a new Image() can have a .onload ref, havent tried. |
Maniac (V) Mad Scientist From: New California |
posted 01-20-2003 10:15
Or you may want to just trigger off of the document.onload event and put all your image detection code in a function that is called by that. It depends on how detailed you need to get. |
Bipolar (III) Inmate From: Belgium |
posted 01-20-2003 11:08
The onLoad event of an IMG tag... |