日期:2014-05-16  浏览次数:20403 次

js倒计时2

<script language="JavaScript">??
<!-- //??
var mySetTimeOut = setTimeout;
window.setTimeout = function(callback, timeout)
{
var args = Array.prototype.slice.call(arguments, 2);
function callFn(){callback.apply(null, args);}
return mySetTimeOut(callFn, timeout);
}
function GetRTime(dmy,ddid,hhid,mmid,ssid){
??? ?var EndTime= new Date(dmy);
???? var NowTime = new Date();
???? var nMS =EndTime.getTime() - 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(nD>= 0){??
????? document.getElementById(ddid).innerHTML=nD;??
????? document.getElementById(hhid).innerHTML=nH;??
????? document.getElementById(mmid).innerHTML=nM;??
????? document.getElementById(ssid).innerHTML=nS;??
???? }??
???? else {??
????????
???? }
???? window.setTimeout(GetRTime,1000,dmy,ddid,hhid,mmid,ssid);
}???

// -->??
</script>

?

?

?

<script language="JavaScript">
GetRTime('<fmt:formatDate value="${tbinfo.tbjs}" pattern="MM/dd/yyyy"/>','infoDd','infoHh','infoMm','infoSs');
</script>