回复讨论(解决方案)
贴代码。。。
倒计时
var baselocation = '';
var importURL = '';
var starttime =new Date("3/8/2011 0");
var now = new Date();
var changeDay = 2;
var endDay = parseInt((now.getDate() + changeDay)/2)*2;
var urodz = new Date((now.getMonth()+1)+"/" + endDay + "/2011 0");
urodz.setTime(urodz.getTime() + 1000 * 60 * 60 * 24 * 2);
now.setDate(now.getDate() + changeDay);
$().ready(function() {
GetServerTimesf();
setInterval("GetServerTimesf()",1000);//用GetServerTimesf
});
function GetServerTimesf() {
if(document.getElementById("time_last")!=null){//time_last1 不是 time_last
now.setTime(now.getTime()+1000);
var days = (urodz - now) / 1000 / 60 / 60 / 24;
var daysRound = Math.floor(days);
var hours = (urodz - now) / 1000 / 60 / 60 - (24 * daysRound);
var hoursRound = Math.floor(hours);
var minutes = (urodz - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
var minutesRound = Math.floor(minutes);
var seconds = (urodz - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
var secondsRound = Math.round(seconds);
$("#h_01").html(hoursRound);
$("#s_01").html(minutesRound);
$("#m_01").html(secondsRound);
$("#h_02").html(hoursRound);
$("#s_02").html(minutesRound);
$("#m_02").html(secondsRound);
$("#h_03").html(hoursRound);
$("#s_03").html(minutesRound);
$("#m_03").html(secondsRound);
}
}
//结束
查看更多关于菜鸟:关于24小时循环倒计时的问题_html/css_WEB-ITnose的详细内容...