DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> 60秒倒計時的一個小JAVASCRIPT
60秒倒計時的一個小JAVASCRIPT
編輯:關於JavaScript     

<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>

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved