How to remove an element slowly with jQuery?

前端 未结 8 1055
失恋的感觉
失恋的感觉 2020-12-12 13:49

$target.remove() can remove the element,but now I want the process to be down with some feel animation,how to do it?

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 14:48

    If you need to hide and then remove the element use the remove method inside the callback function of hide method.

    This should work

    $target.hide("slow", function(){ $(this).remove(); })
    

提交回复
热议问题