jQuery - Waiting for the fadeOut to complete before running fadeIn

后端 未结 3 805
半阙折子戏
半阙折子戏 2020-12-11 00:03

I was wondering if the is any way to wait until the fadeOut is complete before the fadeIn commences, as when i run the following code, it places one div under the other, the

3条回答
  •  囚心锁ツ
    2020-12-11 00:42

    The fadeOut function has a callback that it executes when the animation is done:

    $('.sidebarform').fadeOut('slow', function() {
        $('.sidebarsuccess').fadeIn('slow');
    });
    

提交回复
热议问题