JavaScript 注册按钮读秒倒计时 作者:叶随风  时间:2008-03-17  来源:http://www.popasp.com  浏览:6226 【字号: 】 

一个比较常用的功能:注册按钮读秒倒计时

泡泡ASP相关代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>注册按钮读秒倒计时</title>
</head>
<body style="text-align:center;">
<script language="javascript">
<!--
/*****************************
  注册按钮读秒倒计时
  叶随风(LeafinWind)
  QQ:19855466
  http://www.popasp.com/
*****************************/
var wait = 8; //设置秒数(单位秒)
var secs = 0;         
for(var i=1;i<=wait;i++)
{
 window.setTimeout("sTimer("+i+")",i*1000);
}
function sTimer(num)
{
 if(num==wait)
 {
  document.getElementById("BtnOk").value=" 同意注册 ";
  document.getElementById("BtnOk").disabled=false;
 }
 else
 {
  secs=wait-num;
  document.getElementById("BtnOk").value="请先阅读服务条款 ("+secs+")";
 }
}
//-->
</script>
<div style="width:350px; text-align:center;">
<form name="regForm" method="post" action="">
<input type="hidden" name="action" value="reg">
<input type="submit" value="请先阅读服务条款 (0)" disabled="disabled" id="BtnOk">
<input id="BtnClose" type="button" value=" 我不同意 " onclick="window.close();">
</form>
</div>
</body>
</html>

 * 以上任何内容或信息侵犯了你的利益,请及时联系! 点击此处进入 JavaScript 和 HTML 代码运行页面>>> 
网站建设|免则声明|联系我们|建站知识|反馈留言
Powered By LeafinWind Copyright © 2007-2011 PopAsp.Com, All Rights Reserved
建议使用在1024*768以上的分辨率下浏览本站
  中亿网络