function GetRTime(){
var EndTime= new Date('2016/01/28 19:00:00');
var NowTime = new Date();
var t =EndTime.getTime() - NowTime.getTime();
var d=Math.floor(t/1000/60/60/24);
var h=Math.floor(t/1000/60/60%24);
var m=Math.floor(t/1000/60%60);
var s=Math.floor(t/1000%60);
document.getElementById("t_d").innerHTML = '<span class="bg">'+d+'</span>' + "天";
document.getElementById("t_h").innerHTML = '<span class="bg">'+h+'</span>'+ "小时";
document.getElementById("t_m").innerHTML = '<span class="bg">'+m+'</span>'+ "分";
document.getElementById("t_s").innerHTML = '<span class="bg">'+s+'</span>'+ "秒";
if(d <= 0&& h<=0 &&m<=0&&s<=0){
$(".time").html('已经开始了,赶紧去观看')
}
}
setInterval(GetRTime,0);
倒计时
最新推荐文章于 2024-04-13 16:57:13 发布