jQuery按钮依次淡入

3

我有一堆编号按钮,想要一个接一个地淡入。但是我不确定如何正确处理这个问题。

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());
  });
}

https://jsfiddle.net/dng53ekp/

1个回答

5
所有按钮最初都需要隐藏。使用 display: none css 属性。
button {
    display: none;
}

您的js工作正常。

更新的JSFIDDLE


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接