/**
* 倒计时*/
timerDown:function(){
function checkTime(i)
{
if(i<10)
{
i="0"+i;
}
return i;
}
function changeTime(){
$(".countDown").each(function(){
var timeFinish=$(this).prev(".endDate").val();
if(timeFinish==""||timeFinish=='null'||timeFinish==undefined){
timeFinish=0;
}else{
timeFinish=new Date(timeFinish).getTime();//获取结束时间的毫秒数
};
var currentTime=new Date().getTime();//获取当前时间的毫秒数
var timeLag=parseInt(timeFinish-currentTime)/1000;//获取时差/秒
if(timeLag<=0){
$(this).html("00分00秒");
}else{
var day = parseInt(timeLag/60/60/24);
var hour = parseInt(timeLag/60/60%24);
var minute = parseInt(timeLag/60%60);
var second = parseInt(timeLag%60);
hour = checkTime(hour);
minute = checkTime(minute);
second = checkTime(second);
if(day!=0){
/* var str=day+"天"+hour+"时"+minute+"分"+second+"秒";*/
var str=hour+(day*24)+"时"+minute+"分";
}else if(day==0&&hour!="00"){
/*var str=hour+"时"+minute+"分"+second+"秒";*/
var str=hour+"时"+minute+"分";
}else if(day==0&&hour=="00"&&minute!="00"){
var str=minute+"分"+second+"秒";
}else{
var str=minute+"分"+second+"秒";
};
$(this).html(str);
};
});
};
setInterval(changeTime, 1000);
}