开发者

jquery: how to animate the moveup?

开发者 https://www.devze.com 2023-02-03 23:54 出处:网络
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 on

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

精彩评论

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