How do I animate in jQuery without stacking callbacks?

后端 未结 7 1562
闹比i
闹比i 2020-12-08 05:37

Let\'s say I have three divs, and I\'d like each to animate once the previous one is done. Currently, I write this:

$(\'div1\').fadeOut(\'slow\', function()          


        
7条回答
  •  温柔的废话
    2020-12-08 06:13

    try something like:

    $( 'div1' ).fadeOut();
    $( 'div2' ).delay( 500  ).fadeOut();
    $( 'div3' ).delay( 1000 ).fadeOut();
    

    Adjust the timing as necessary

提交回复
热议问题