正在加载中...
信息详页
返回
来源:转载 浏览量:245 次 发布日期:2018-02-22
<SCRIPT LANGUAGE="JavaScript"> <!-- var maxtime; if(window.name==''){ maxtime = 60*60; }else{ maxtime = window.name; } function CountDown(){ if(maxtime>=0){ minutes = Math.floor(maxtime/60); seconds = Math.floor(maxtime%60); msg = "距离结束还有"+minutes+"分"+seconds+"秒"; document.all["timer"].innerHTML = msg; if(maxtime == 5*60) alert('注意,还有5分钟!'); --maxtime; window.name = maxtime; } else{ clearInterval(timer); alert("时间到,结束!"); } } timer = setInterval("CountDown()",1000); //--> </SCRIPT> <div id="timer" style="color:red"></div> |