当我们删除一个元素时希望能看到删除的过程,这个效果通过对元素进行淡出展示动态化删除过程。
$("#myButton").click(function() {
$("#myDiv").fadeTo("slow", 0.01, function(){//fade
$(this).slideUp("slow", function() {//slide up
$(this).remove();//then remove from the DOM
});
});
});