我用下面的代码:停止和恢复jQuery的动画
$('#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
按钮。如何暂停或恢复我开始使用上述代码的动画?
尝试添加小提琴....最小可能的代码 –
请检查这个http://jsfiddle.net/hasmukhmistry/sztkso3y/ –
我已经编辑我的答案,pl轻松尝试一下。 –