我有一堆编号按钮,想要一个接一个地淡入。但是我不确定如何正确处理这个问题。
var animations = new Array();
// queue all
$(".owl-thumb-item").each(function() {
animations.push($(this));
});
// start animating
doAnimation(animations.shift());
function doAnimation(image) {
image.fadeIn("slow", function() {
// wait until animation is done and recurse if there are more animations
if (animations.length > 0) doAnimation(animations.shift());
});
}