JavaScript. I want to create simple script, that will be resize loaded image using css width and height. Here is code example:
<img style="width:200px; height:200px"
src="http://doc.jsfiddle.net/_downloads/jsfiddle-desktop-1440x900-a.png" onLoad="
//need resize code here
"/>
I'm trying to resize image with original size ratio. But I can't access original size. When I want to select original size by this.height it gives me css size. And where to find original value? And how to change size? this.style.height = '200px' ????
style.width = 'auto'andstyle.height = 'auto'first and then measuring it work?