WEB开发网
开发学院WEB开发Jsp 60秒倒计时的一个小JAVASCRIPT 阅读

60秒倒计时的一个小JAVASCRIPT

 2008-01-05 19:01:22 来源:WEB开发网   
核心提示:<table name=agree border="0" cellpadding="10" cellspacing="0" align=center width="80%"><tr align=center><

<table name=agree border="0" cellpadding="10" cellspacing="0" align=center width="80%">
<tr align=center>
<td width="50%" align="right">
<FORM name=register method=post action=reg_shang.asp?action=yes>
<input type="hidden" name="action" value="agree"><INPUT class="go-wenbenkuang" type=submit value=" 同意注册 " name=Submit>
</FORM>
</td>
<td width="50%" align="left">
<FORM action=index.asp method=post><INPUT class=go-wenbenkuang type=submit value=" 我不同意 "></FORM></td>
</tr>
</table>

<SCRipT>
 secs = 60; // Number of secs to delay -CHINA-studio
 wait = secs * 100;
 document.forms.register.Submit.disabled =true;
 for(i=1;i<=(wait/100);i++) {
  window.setTimeout("doUpdate(" + i + ")", i * 100);
 }
 window.setTimeout("Timer()", wait);

 function doUpdate(num) {
  if(num == (wait/100)) {
  document.forms.register.Submit.value = " 同意注册 ";
  } else {
  wut = (wait/100)-num;
  document.forms.register.Submit.value = " 同意前请先阅读 (" + wut + ")";
  }
 }

 function Timer() {
  document.forms.register.Submit.disabled =false;
}
</SCRIPT>


Tags:倒计时 一个 JAVASCRIPT

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接