• js秒读功能


    <?xml version="1.0" encoding="UTF-8" ?>
    <!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"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head xmlns:h="http://java.sun.com/jsf/html">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登录控制</title>

    <script>
    //<![CDATA[
    //var bt = document.getElementById('rulesubmit');
    var bt;
    var wait
    var str
    function waitmit(secs,tmp) {
    wait = secs * 1000;
    bt=tmp;
    str = tmp.value;
    bt.value = str+"(" + secs + ")";
    bt.disabled = true;

    for ( var i = 1; i <= secs; i++) {
    window.setTimeout("update("+i+")", i * 1000);
    }
    window.setTimeout("timer()", wait);
    }
    function update(num) {
    if (num == (wait / 1000)) {
    bt.value = str;
    } else {
    var printnr = (wait / 1000) - num;
    bt.value = str+"(" + printnr + ")";
    }
    }
    function timer() {
    bt.disabled = false;
    bt.value = str;
    }
    //]]>
    </script>
    </h:head>
    <body>
    <h:commandButton value="修改" onclick="waitmit(9,this);"></h:commandButton>
    </body>
    </html>

    自己封装的js秒读功能,欢迎大家改善。

  • 相关阅读:
    python requests模块
    python 模拟豆瓣登录(豆瓣6.0)
    python 抓取糗事百科糗图
    python bz2模块
    the python challenge闯关记录(9-16)
    python之PIL库(Image模块)
    python之zipfile
    python之pickle模块
    the python challenge闯关记录(0-8)
    KVO简介
  • 原文地址:https://www.cnblogs.com/cxyzl/p/2619968.html
Copyright © 2020-2023  润新知