Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting image dimensions

Status
Not open for further replies.

gormster

Technical User
Mar 1, 2005
27
AU
is there some way to get the dimensions of an image before it loads on to the page?

if you're wondering why, i need the dimensions for a script that runs at body onLoad but can't use the image.width and image.height properties, because at the time of loading they are undefined.
 
w/ javascript yu can preload images...this may be what you can do; however, i suggest you post in js forum where they can give you a better answer...in theory it seems like it wuld work because it preloads the images before showing to browser...it's here where you can capture the sizes for the function...

may wanna look over this:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top