Monday, 18 August 2014

HTML DOM Image naturalWidth, naturalHeight Property 0

The Javascript's naturalWidth and naturalHeight properties will return original width and height of an image.
For an example, If we are using an image with 350px original width and 225px original height, It will return the same height and width even we made changes in DOM's height and width property.

The following DEMO will make you understand more what I'm saying. 


In this DEMO the original image size of image is 350 x 225 px. We are also changed image width and height property. But now also it's returning the actual size.



0 comments:

Post a Comment