Reputation: 184
I am using jquery ui resizable control to resize image.
I want resize the image with aspect ratio.
but it is now working properly.
Here is the script:
$("#cover_page_image_change").resizable({ aspectRatio:true});
Hence I think if we can change the maxHeight and maxWidth options of it then it may possible. We will provide these option dynamically by calculating the real aspect ration.
Is any one know how to do it?
Or for aspect ratio what should i do? I am using jquery ui 1.9 version
Upvotes: 0
Views: 194
Reputation: 354
In this way you can provide width and height
var coverpagee=$('#cover_page_image_change');
var val=2;
coverpage.css({
width:target.width() * val,
height:target.height() * val});
Rather than using val
you can use any variable whose value get assigned dynamically.
Upvotes: 1