【发布时间】:2014-07-25 06:37:19
【问题描述】:
将一系列 Promise 写成一系列最终可以收集的动画的语法是什么?我已经阅读了 jquery 手册,查看了一些相关的 SO 问题,但我似乎无法在所有动画完成后触发 .done() 消息。
到目前为止的代码:
$.when(
$graphName.fadeIn(500).promise().then(function(){
$graphaxes.each(function(index) {
$(this).delay(500*index).fadeIn(700).promise().then(function(){
$(".circle.bk").each(function(index) {
$(this).delay(500*index).fadeIn(700).promise().then( function(){
$graphlabel.each(function(index) {
$(this).delay(600).fadeIn(800).promise().then( function(){
fadeLabels();
$(".circle").each(function(index) {
$(this).delay(500*index).fadeIn(700).promise();
});
});
});
});
});
});
});
})
).done(function(){
console.log("All animations complete");
});
【问题讨论】:
-
您已删除,然后又取消删除,您要答复还是要再次删除?
-
我想要一个正确的方向或答案!提前致谢。