Solution 1 :

Once everything is done then you can reset the width property using this:


if you want pre-defined or dynamic values you can use something like this:

var tmp= 50;

Problem :

I have an image tag, which I wish to resize in proportion using width() method after uploading an image as below;

    tmp = $('#asd').width()*0.614;

Problem is, the width of the element must be calculated with every upload, and the upload is repeatable. With the code above, starting from the second upload, the width is calculated from the width set by jQuery and not from the dimensions of the uploaded image.

I wish to “undo” or “reset” the width set by the width() method so it becomes dynamic by the uploaded image’s dimensions. How do I do that?