我正在尝试使用 jQuery plugin countdown 2.1来计算时间。我需要从 0 开始计时,每次计数一秒。
这是我所做的
$('#MasterBreakTimer').countdown(new Date(),
{
elapsed: true,
strftime: '%H:%M:%S'
});
但它没有显示任何内容
如何正确实现计数时钟?
最佳答案
我明白了。
我需要添加一个事件来显示结果,如下所示
$('#MasterBreakTimer').countdown(new Date(),
{
elapse: true,
strftime: '%H:%M:%S'
}).on('update.countdown', function(event){
$(this).html(event.strftime('<span>%H:%M:%S</span>') );
});
关于javascript - 如何使用 jQuery 倒计时插件创建计时器 "count up"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35004559/