I have a list of DIVs arranged vertically, I already use .fadeOut() to delete one of the DIV in the middle, but I don't know how to generate the slowly moveup effect for the DIVs below the deleted one.
How to do t开发者_如何学运维hat?
To get both the fadeout and the slide up, you can use the excellent "animate" call:
$("#mydiv").animate({ opacity: "0", height: "0" });
try something like this..
$('#clickme').click(function() {
$('#div').slideUp('slow', function() {
// Animation complete.
});});
example
for more reference read this..slideUp
try this,
for (var i = 0; i < 5; i++) {
$("<div>").appendTo(document.body);
}
$("div").click(function () {
$(this).hide(2000, function () {
$(this).remove();
});
});
reference here
精彩评论