<?php if(1){ ?>
<!-- 距离秒杀结束时间倒计时 s -->
<style>
.ncs-btn span.w_daojishi{color:#bf0250;}
</style>
<h1 > <i class="icon-time"></i>距离秒杀结束时间还有:<span id="sd1" class="w_daojishi"><?php echo $output['goods']['daojishi']['d'];?></span><strong>天</strong><span id="sh1" class="w_daojishi"><?php echo $output['goods']['daojishi']['h'];?></span><strong>时</strong><span class="w_daojishi" id="sm1"><?php echo $output['goods']['daojishi']['i'];?></span><strong>分</strong><span id="ss1" class="w_daojishi"><?php echo $output['goods']['daojishi']['s'];?></span><strong>秒</strong></h1>
<script type="text/javascript">
var tms = [];
var day = [];
var hour = [];
var minute = [];
var second = [];
tms[tms.length] = "<?php echo $output['goods']['count_seconds']?>";
day[day.length] = "sd1";
hour[hour.length] = "sh1";
minute[minute.length] = "sm1";
second[second.length] = "ss1";
function secStopCount() {
for (var i = 0, j = tms.length; i < j; i++) {
tms[i] -= 1;
//计算天、时、分、秒、
var days = Math.floor(tms[i] / (1 * 60 * 60 * 24));
var hours = Math.floor(tms[i] / (1 * 60 * 60)) % 24;
var minutes = Math.floor(tms[i] / (1 * 60)) % 60;
var seconds = Math.floor(tms[i] / 1) % 60;
if (days < 0)
days = 0;
if (hours < 0)
hours = 0;
if (minutes < 0)
minutes = 0;
if (seconds < 0)
seconds = 0;
//将天、时、分、秒插入到html中
document.getElementById(day[i]).innerHTML = days;
document.getElementById(hour[i]).innerHTML = hours;
document.getElementById(minute[i]).innerHTML = minutes;
document.getElementById(second[i]).innerHTML = seconds;
if(days==0&&hours==0&&minutes==0&&seconds==0){
clearInterval(stop_jishiqi);
window.location.reload();
}
}
}
$(function(){
var stop_jishiqi = setInterval(secStopCount, 1000);
});
</script>
<!-- 距离秒杀结束时间倒计时 e -->
<?php } ?>