如何在计时器结束时重复 JQuery 计数器
How do I repeat JQuery Counter when timer finished
我找到了一个很棒的计数器脚本,但在其中一个脚本上,我需要在计数达到 999 后重复它。我应该添加什么来让它在计数完成后重复?
jQuery_2_2_4('#count-five').jQuerySimpleCounter({
start : 0,
end : 999,
// easing effect
easing : 'linear',
// duration time in ms
duration : 100000
});
计数器插件公开了一个 complete
回调。如果您希望它重复,运行 完整函数中的相同命令。这是一种方法:
function repeatCounter() {
jQuery_2_2_4('#count-five').jQuerySimpleCounter({
start : 0,
end : 999,
// easing effect
easing : 'linear',
// duration time in ms
duration : 100000,
complete: repeatCounter
});
}
repeatCounter();
我找到了一个很棒的计数器脚本,但在其中一个脚本上,我需要在计数达到 999 后重复它。我应该添加什么来让它在计数完成后重复?
jQuery_2_2_4('#count-five').jQuerySimpleCounter({
start : 0,
end : 999,
// easing effect
easing : 'linear',
// duration time in ms
duration : 100000
});
计数器插件公开了一个 complete
回调。如果您希望它重复,运行 完整函数中的相同命令。这是一种方法:
function repeatCounter() {
jQuery_2_2_4('#count-five').jQuerySimpleCounter({
start : 0,
end : 999,
// easing effect
easing : 'linear',
// duration time in ms
duration : 100000,
complete: repeatCounter
});
}
repeatCounter();