如何延迟jquery动画? [英] How to delay jquery animation?
本文介绍了如何延迟jquery动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我似乎无法延迟 div 的显示.我想将动画延迟大约 20 秒这可能吗???
I can't seem to delay the showing of a div. I want to delay the animation by about 20 seconds is this possible???
$("#microcharcounter").delay(10000).show();
推荐答案
试试这个:
$("#microcharcounter").delay(10000).show(0);
或者这个:
$("#microcharcounter").delay(10000).queue(function(n) {
$(this).show();
n();
});
这样做的原因是 .delay()
只会延迟动画队列中的项目.所以你可以通过添加'0'的持续时间来制作 .show()
一个简短的动画,或者使用 .queue()
.
The reason for this is that .delay()
will only delay items in an animation queue. So you can make .show()
a short animation by adding a duration of '0', or add it to the queue with .queue()
.
这篇关于如何延迟jquery动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文