How to remove an element slowly with jQuery?

前端 未结 8 1065
失恋的感觉
失恋的感觉 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:39

    All the answers are good, but I found they all lacked that professional "polish".

    I came up with this, fading out, sliding up, then removing:

    $target.fadeTo(1000, 0.01, function(){ 
        $(this).slideUp(150, function() {
            $(this).remove(); 
        }); 
    });
    

提交回复
热议问题