<div class="htmlarea"> <textarea id="runcode70202"> <title>根据鼠标判断时间:Js倒计时</title> <input type="button" id="downloadbtn" class="meng1an" onclick='if(timeout>0) {alert("停止计时");return false;}document.location="#"; this.disabled=true;'> <script type="text/javascript"> <!-- var timeCount var timeout='10'; function countdown() { if (timeout <= 0) { document.getElementById("downloadbtn").value = '时间到'; if(document.getElementById("downloadfile"))document.getElementById("downloadfile").style.display = ''; } if (timeout > 0) { document.getElementById("downloadbtn").value = '还有 '+timeout+' 秒'; timeCount = setTimeout('countdown()',1000); } timeout--; } countdown(); document.onmouseover= function(){clearTimeout(timeCount);countdown();} document.onmouseout= function(){clearTimeout(timeCount);} --> </script> </textarea><br><input onclick="runEx('runcode70202')" type="button" value="运行代码"> <input onclick="doCopy('runcode70202')" type="button" value="复制代码"> <input onclick="doSave(runcode70202)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>