function countDown(){
var timeBox = $('.countdown i');
var endTime = new Date(timeBox.data('time')),
starTime = new Date(),
ts = endTime.getTime()-starTime.getTime(),
d= 0,
h= 0,
m = 0,
s= 0;
if(ts>=0){
d=Math.floor(ts/1000/60/60/24);
h=Math.floor(ts/1000/60/60%24);
m=Math.floor(ts/1000/60%60);
s=Math.floor(ts/1000%60);
}
timeBox.html(h+"小时"+m+"分"+s+"秒");
setTimeout(countDown,1000);
}
var timeBox = $('.countdown i');
var endTime = new Date(timeBox.data('time')),
starTime = new Date(),
ts = endTime.getTime()-starTime.getTime(),
d= 0,
h= 0,
m = 0,
s= 0;
if(ts>=0){
d=Math.floor(ts/1000/60/60/24);
h=Math.floor(ts/1000/60/60%24);
m=Math.floor(ts/1000/60%60);
s=Math.floor(ts/1000%60);
}
timeBox.html(h+"小时"+m+"分"+s+"秒");
setTimeout(countDown,1000);
}