Jquery 倒计时、24 小时和周末规则
Jquery countdown, 24hour and rules for weekends
我在这里添加了代码
当它在 11.00 之后到达星期五时,它应该倒计时到钱 @ 11.00
有什么建议/帮助到达这里吗?
另外:CountDown-timer 还应该能够检查它是否是丹麦的假期(不确定这个功能,也许是一个数据库来控制那部分,因为假期会以变量的形式出现,嗯?)
http://jsfiddle.net/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);
我不确定这是你想要的。请检查一次代码。
Javascript:
function ShowTime() {
var now = new Date();
if (now.getHours() > 11){
var hrs =11-now.getHours()+24;
if(now.getDay() == 5){
var hrs = hrs + 48;
}
}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);
Fiddle : Fiddle
我在这里添加了代码 当它在 11.00 之后到达星期五时,它应该倒计时到钱 @ 11.00 有什么建议/帮助到达这里吗? 另外:CountDown-timer 还应该能够检查它是否是丹麦的假期(不确定这个功能,也许是一个数据库来控制那部分,因为假期会以变量的形式出现,嗯?) http://jsfiddle.net/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);
我不确定这是你想要的。请检查一次代码。
Javascript:
function ShowTime() {
var now = new Date();
if (now.getHours() > 11){
var hrs =11-now.getHours()+24;
if(now.getDay() == 5){
var hrs = hrs + 48;
}
}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);
Fiddle : Fiddle