且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在下一个开始之前等待一个 jquery 动画完成?

更新时间:2022-06-03 06:06:55

http://api.jquery.com/animate/一个>

animate 有一个完整"的功能.您应该将第二个动画放在第一个的完整功能中.

animate has a "complete" function. You should place the 2nd animation in the complete function of the first.

示例 http://jsfiddle.net/xgJns/

$("#div1").animate({opacity:.1},1000,function(){
    $("#div2").animate({opacity:.1},1000);    
});​