zoukankan      html  css  js  c++  java
  • 进度条的javascript实现方式

    <!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>
    <style type="text/css">
    #out{
    80%;
    height:20px;
    background-color:#FFFFFF;
    border-bottom-style:solid;
    border-top-style:solid;
    border-left-style:solid;
    border-right-style:solid;

    margin:0 auto;

    }
    #inner{
    height:20px;
    0%;
    background-color:#00CC00;
    text-align:right;




    }
    #showProgress{
    text-align:center;

    }
    #showProgress input{
    border:hidden;
    background-color:#999999;
    text-align:center;


    }
    #all{
    text-align:center;
    margin:50px auto;
    }

    </style>
    </head>

    <body>
    <div id="all">
    <div id="out">
    <div id="inner"></div>
    </div>
    <div id="showProgress"><input type="text" id="showPro" align="center" /></div>
    <input type="button" onclick="javascript:myRefress();" value="onload"/>
    <input type="button" onclick="javascript:complementBar();" value="reset"/>
    <input type="button" onclick="javascript:showBar();" value="showBar"/>
    </div>
    <script type="text/javascript">
    var i=0;
    var fun;
    function setProgressBar(pro){
    document.getElementById("inner").style.width=pro+"%";
    }
    function complementBar(){
    document.getElementById("inner").style.display="none";


    }
    function myRefress(){
    setProgressBar(i);
    document.getElementById("showPro").value=i+"%";
    i++;
    if(i<100){
    fun=setTimeout("myRefress()",100);
    }else{
    complementBar();
    i=0;
    }
    }
    function showBar(){
    document.getElementById("inner").style.display="block";
    }
    function showPro(){


    }

    </script>
    </body>
    </html>

  • 相关阅读:
    json to dictionary
    ie下 频繁异步加载导致崩溃
    如何实现数据在表内部置顶
    js货币转换,replaceAll写法
    js奇怪的问题
    mssql中public和db_owner权限下拿到webshell或者系统权限
    关于Alexa Toolbar的破解方法
    如何备份和还原 IIS
    WIN下IIS备份与恢复操作
    汽车品牌标志数据库
  • 原文地址:https://www.cnblogs.com/moonfans/p/2985655.html
Copyright © 2011-2022 走看看