<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;'> </textarea> <br><input onclick="runEx('runcode70202')" type="button" value="运行代码"><input onclick="doCopy('runcode70202')" type="button" value="复制代码"> <input onclick="doSave(runcode70202)" type="button" value="保存代码"> <a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">[Ctrl A 모두 선택 참고: </a>외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다 </div>]<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>