$('#art1').animate({'width':'1000px'},1000);
$('#art2').animate({'width':'1000px'},1000);
$('#art3').animate({'width':'1000px'},1000);
我知道在jQuery中可以这样做:
$('#art1').animate({'width':'1000px'},1000,'linear',function(){
$('#art2').animate({'width':'1000px'},1000,'linear',function(){
$('#art3').animate({'width':'1000px'},1000);
});
});
但是,假设我不使用jQuery,我想调用:
some_3secs_function(some_value);
some_5secs_function(some_value);
some_8secs_function(some_value);
我应该如何调用这些函数来执行some_3secs_function
,并在此调用结束后,再执行some_5secs_function
,在此调用结束后,再调用some_8secs_function
?
更新: 这仍然不起作用:(function(callback){
$('#art1').animate({'width':'1000px'},1000);
callback();
})((function(callback2){
$('#art2').animate({'width':'1000px'},1000);
callback2();
})(function(){
$('#art3').animate({'width':'1000px'},1000);
}));
三个动画同时开始
我的错误在哪里?