How do I re-initialize jQuery resize wrapper? -
trying image resize , dragging using jquery ui. having issue this,
below added automatically jquery iu. doesn't change original size if load different image. means keep original images width , hight though load different image dynamically.
<div style="overflow: hidden; position: absolute; width: 493px; height: 370px; top: 0px; left: 0px; margin: 0px;" class="ui-wrapper">
this html
<div id="photo-area"> <div id="photo-canvas"> <div class="design-mask"> </div> <div class="photo-wrap"> <div class="photo-resize"> <img id="photo-mask" class="pp-photo" /> </div> </div> </div>
and javascript
$j(".photo-wrap").draggable({ containment: "#photo-canvas", opacity: 0.35, }); $j(".pp-photo").resizable({ aspectratio: true, ghost: true, });
i upload files through php script saves image on server , pass json image data js function loads image,
$j.each(data.result.files, function (index, file) { $j('#photo-mask').load( function(){ //jquery draggable code ..... ..... //jquery resizable code ..... ..... }).attr("src",file.url); });
any ideas how fix this?
found solution issue, every time load new photo following. initialise resize object:
$j('.dl-photo').resizable("destroy");
Comments
Post a Comment