我已经在这里添加了代码当它在 11.00 之后到达星期五时,它应该倒计时到金钱 @ 11.00 有什么建议/帮助到达这里吗?另外: CountDown-timer 还应该能够检查它是否在丹麦这里度假(不确定这个功能,也许是一个控制该部分的数据库,因为假期会出现在变量中嗯?) http://jsfiddle。净/srwpyac0/24/
HTML:
<div id="countdown"></div>
JavaScript
function ShowTime() {
var now = new Date();
if (now.getHours() > 11) {
var hrs = 11 - now.getHours() + 24;
} else {
var hrs = 11 - now.getHours();
}
var mins = 60 - now.getMinutes();
var secs = 60 - now.getSeconds();
timeLeft = "You now have " + hrs + ' Hour(s) ' + mins + ' minuts ' + secs + ' seconds' + " To complete the order, and make sure the delivery will reach to you in 1-3 days";
$("#countdown").html(timeLeft);
}
var countdown;
function StopTime() {
clearInterval(countdown);
}
setInterval(ShowTime, 1000);