
编号:41179
名称:jQuery商家活动倒计时
类型:网站常用
价格:5000
下载积分:20
下载次数:0
介绍:
<div id="daoend" style="display:none;">本次活动已结束。</div> <div id="dao"><strong id="RemainD"></strong>天<strong id="RemainH"></strong>时<strong id="RemainM"></strong>分<strong id="RemainS"></strong>秒</div>
var startTime = new Date();
startTime.setFullYear(2016, 5, 27);
startTime.setHours(23);
startTime.setMinutes(59);
startTime.setSeconds(59);
startTime.setMilliseconds(999);
var EndTime = startTime.getTime();
function GetRTime() {
var NowTime = new Date();
var nMS = EndTime - NowTime.getTime();
var nD = Math.floor(nMS / (1000 * 60 * 60 * 24));
var nH = Math.floor(nMS / (1000 * 60 * 60)) % 24;
var nM = Math.floor(nMS / (1000 * 60)) % 60;
var nS = Math.floor(nMS / 1000) % 60;
if (nMS < 0) {
$("#dao").hide();
$("#daoend").show();
} else {
$("#dao").show();
$("#daoend").hide();
$("#RemainD").text(nD);
$("#RemainH").text(nH);
$("#RemainM").text(nM);
$("#RemainS").text(nS);
}
}
$(document).ready(function() {
var timer_rt = window.setInterval("GetRTime()", 1000);
});
