remove() not removing a resized image
jQuery says about the .remove() method
Use .remove() when you want to remove the element itself, as well as
everything inside it. In addition to the elements themselves, all bound
events and jQuery data associated with the elements are removed.
But if you remove() the ui-wrapper around an image that has resizing, that
doesn't seem to be the case. The image inside the ui-wrapper is left in
the DOM. See jsfiddle here http://jsfiddle.net/stevea/jP6NY/2/.
So what is the proper way to removed an image that has resizing?
$(function(){
$('#pelican').resizable({handles : 'ne,se,sw,nw', aspectRatio : true});
});
$('button#removeImg').click(function() {
$('.ui-wrapper').remove();
});
Thanks
No comments:
Post a Comment