Javascript Reference
Categories: IMG

javascript IMG naturalHeight, naturalWidth

@May 8, 2008, 3:08 p.m.
naturalHeight, naturalWidth Firefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM n/a  

 

Read-only  

Return the unscaled height and width of the image, in pixels. Allows scripts to find the true dimensions of the original image in case scripts or incorrect element attributes have scaled the image.

 
Example
 
document.logoImg.height = document.logoImg.naturalHeight;
document.logoImg.width = document.logoImg.naturalWidth;
 
Value

Integer.

 
Default

None.


Powered by Linode.