var update_time = function(){
var time = $('.time').data('time'),
day,hour,minute,second,unit,
rest_time = time - 1,
num = 1,
str ='';
$('.temporary-time').data('time',rest_time);
day = Math.floor(rest_time/60/60/24);
if(day){
rest_time -= day*60*60*24;
}
hour = Math.floor(rest_time/60/60);
if(hour){
rest_time -= hour*60*60;
}
minute = Math.floor(rest_time/60);
if(minute){
rest_time -= minute*60;
}
second = rest_time;
unit = {
'天':day,
'时':hour,
'分':minute,
'秒':second
}
for(var item in unit){
str += unit[item]+item;
num ++;
}
$('.temporary-time').text(str);
}
update_time();
setInterval(update_time,1000);
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。