remove() not removing a resized image

前端 未结 1 1753
名媛妹妹
名媛妹妹 2021-01-27 18:05

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

相关标签:
1条回答
  • 2021-01-27 18:49

    To remove the image and the wrapper that was created during the call to .resizable, use:

    $('#pelican').remove();
    

    To remove just the ability to resize the image, while leaving the image in its resized state, use:

    $('.ui-wrapper').remove();
    

    The reason for this is that jQuery and the jQuery UI widgets do some "tidying up" during the calls to .remove(), and the resizable's destructor, producing the behaviour above.

    0 讨论(0)
提交回复
热议问题