【发布时间】:2015-10-14 08:18:04
【问题描述】:
我使用了以下代码:
$('#counter').each(function () {
var $this = $(this);
jQuery({
Counter: 0
}).animate({
Counter: $this.text()
}, {
duration:30000,
easing: 'swing',
step: function () {
$this.text(Math.ceil(30 - this.Counter));
},
complete: function() {
$("#count_block").css("display","inline-block");
$this.text(0);
}
});
});
我的网页上有一个Pause 和Resume 按钮。如何暂停或恢复使用上述代码开始的动画?
【问题讨论】:
-
尝试添加小提琴....尽可能少的代码
-
我已经编辑了我的答案,请尝试一下。
-
@HasmukhMistry: jsfiddle.net/tahirahmed/d0bsce1p
标签: jquery jquery-ui jquery-animate