Reputation: 2295
I would like to know how to make resizable image with jQuery on the fly. It's something like an image has resizable border and we can drag that border with mouse in order to become smaller or bigger of the image. When I use resizable, only background continent become bigger but image is still the same size. Thanks in advance for your precious replies!
Upvotes: 2
Views: 13238
Reputation: 72
CSS
.container { width:130px; height:200px; }
.container img {
width:100%; /* Set to auto to preserve aspect ratio */
height:100% }
HTML:
<div class=container><img src=yourimg.jpg /></div>
JS
$('div.container').resizable()
Works in FF
Upvotes: 0
Reputation: 30384
With image html like this:
<img id="resizebleImage" src="images/mypic.gif" width="200px"
height="135px">
jquery
$(function(){
$("#resizebleImage").resizable();
});
Upvotes: 8
Reputation: 9691
Are you applying resizable to the div container or the actual image?
as in:
$('img').resizable();
Sorry not sure about the syntax.
Upvotes: 1