fadeOut() and slideUp() at the same time?

后端 未结 6 994
难免孤独
难免孤独 2020-12-02 13:05

I have found jQuery: FadeOut then SlideUp and it\'s good, but it\'s not the one.

How can I fadeOut() and slideUp() at the same time? I trie

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 13:35

    Throwing one more refinement in there based on @CodeKoalas. It accounts for vertical margin and padding but not horizontal.

    $('.selector').animate({
        opacity: 0,
        height: 0,
        marginTop: 0,
        marginBottom: 0,
        paddingTop: 0,
        paddingBottom: 0
    }, 'slow', function() {
        $(this).hide();
    });
    

提交回复
热议问题