日期:2014-05-18 浏览次数:20767 次
<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312"> <head> <head> <title> 倒计时效果 </title> <meta http-equiv="content-type" content="text/html; charset=gb2312" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <script language="JavaScript"> <!-- // var startTime = new Date(); var EndTime=startTime.getTime()+100*60*1000; function GetRTime(){ var NowTime = new Date(); var nMS =EndTime - 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; //document.getElementById("RemainD").innerHTML=nD; document.getElementById("RemainH").innerHTML=nH; document.getElementById("RemainM").innerHTML=nM; document.getElementById("RemainS").innerHTML=nS; if(nMS>5*59*1000&&nMS<=5*60*1000) { alert("还有最后五分钟!"); } setTimeout("GetRTime()",1000); } window.onload=GetRTime; // --> </script> </head> <body> <div id="CountMsg">倒计时还有:<strong id="RemainD"></strong><strong id="RemainH">XX</strong>时<strong id="RemainM">XX</strong>分<strong id="RemainS">XX</strong>秒</div> </body> </html>