我的网站上有倒计时,我希望它倒计时到下周五,当周五结束时,我希望它自动倒计时到下周五.. 重复一遍..
我有这个脚本,但似乎无法让它工作,有人可以帮我吗?
提前致谢
$(function(){
var note = $('#note'),
ts = new Date(5), //Setting the date here
newYear = true;
if((new Date()) > ts){
ts = (new Date()).getTime() + 10*24*60*60*1000;
newYear = false;
}
$('#countdown').countdown({
timestamp : ts,
callback : function(days, hours, minutes, seconds){
var message = "";
message += days + " day" + ( days==1 ? '':'s' ) + ", ";
message += hours + " hour" + ( hours==1 ? '':'s' ) + ", ";
message += minutes + " minute" + ( minutes==1 ? '':'s' ) + " and ";
message += seconds + " second" + ( seconds==1 ? '':'s' ) + " <br />";
if(newYear){
message += "left until the new year!";
}
else {
message += "left to 10 days from now!";
}
note.html(message);
}
});
});