zoukankan      html  css  js  c++  java
  • jquery 60秒倒计时

    <!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=utf-8" />
    <title>30秒</title>
    </head>
    <body>

    <div style="280px;margin:40px auto 0 auto;">
    <form action="#" method="post" name="agree"> 
    <input type="button" value="请认真查看<服务条款和声明> (5)" name="agreeb" id="agreeb">
     </form> 
    </div>

    <SCRIPT language=javascript>
    <!--
    // var secs = 5;
    // document.agree.agreeb.disabled=true;
    // for(i=1;i<=secs;i++) {
    // window.setTimeout("update(" + i + ")", i * 1000);
    // }
    // function update(num) {
    // if(num == secs) {
    // document.agree.agreeb.value =" 我 同 意 ";
    // document.agree.agreeb.disabled=false;
    // }
    // else {
    // printnr = secs-num;
    // document.agree.agreeb.value = "请认真查看<服务条款和声明> (" + printnr +")";
    // }
    // }

    var secs = 5;
    document.getElementById('agreeb').disabled=true;
    for(i=1;i<=secs;i++) {
    window.setTimeout("update(" + i + ")", i * 1000);
    }
    function update(num) {
    if(num == secs) {
    document.getElementById('agreeb').value =" 我 同 意 ";
    document.getElementById('agreeb').disabled=false;
    }
    else {
    printnr = secs-num;
    document.getElementById('agreeb').value = "请认真查看<服务条款和声明> (" + printnr +")";
    }
    }
    //-->
    </SCRIPT>
    </body>
    </html>

  • 相关阅读:
    [TJOI2013]循环格
    [CQOI2017]小Q的表格
    【51nod 1514】 美妙的序列
    【bzoj3456】 城市规划
    [SHOI2010]最小生成树
    CF438E The Child and Binary Tree
    bzoj 4712: 洪水
    POJ-3069 Saruman's Army---区间选点
    POJ-3617 Best Cow Line---字符串贪心
    HDU-1850 Being a Good Boy in Spring Festival---尼姆博奕的运用
  • 原文地址:https://www.cnblogs.com/roves/p/4877833.html
Copyright © 2011-2022 走看看