I'm using jQuery UI's resizable function to resize a div containing an image. On initial page load, the div contains someimage.png and the resizing works fine with the code below. The handle appears on the bottom right corner and I can click and drag it to resize the div.
jQuery("#imgdiv").resizable();
<div id="imgdiv" class="ui-widget-content">
<img src="someimage.png" />
</div>
Then I submit a form and a new image is fetched from a rails server using ajax:
page.replace_html 'imgdiv', "<img src=\"newimg.png\">"
This updates the div with the new image but the resizable handle disappears and I can no longer resize the div. Do you know why this might be? Thanks.