我正在使用这些 jQuery 插件:jQuery Countdown .
我试图让它每天倒计时到 17:00(下午 5:00),但我似乎无法设置时间。
欢迎任何帮助。
我的代码是:
$(function() {
var now = new Date()
var since = new Date(now.getFullYear(), now.getMonth(), now.getDay(), 17, 00);
$('#noDays').countdown({until: since, format: 'HMS'});
});
使用此代码,计时器卡在 0。
最佳答案
试试这个(和工作示例 here ):
$(function() {
var liftoff = new Date();
liftoff = new Date(liftoff.getFullYear(), liftoff.getMonth(), liftoff.getDate(), 17, 0, 0);
$('#noDays').countdown({until: liftoff});
});
关于javascript - 如何使用 jQuery 倒计时确定特定时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7887516/