开发者

jquery: how to animate the moveup?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜