开发者

How do I make a div slide up and disappear in JQuery?

开发者 https://www.devze.com 2022-12-21 02:49 出处:网络
And just...poop, HTML gone. How do I开发者_如何学JAVA do that? thanks. I know about .hide() , but..I want permanently gone (for that one page), and slide up.You can use slideUp() to slide it and then

And just...poop, HTML gone. How do I开发者_如何学JAVA do that? thanks.

I know about .hide() , but..I want permanently gone (for that one page), and slide up.


You can use slideUp() to slide it and then use remove() to remove it. Something like this:

$("#buttonid").click(function() {
    $("selector").slideUp("slow", function() { $(this).remove(); });
});

remove() will remove the element from the dom.


You can use .slideUp()

http://api.jquery.com/slideUp/


You want the jQuery UI function called slide(), then call $(this).remove() in the callback, like so:

$(function() { $('div').click(function() { $(this).slideUp('slow', function() { $(this).remove(); }); }); });

0

精彩评论

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

关注公众号