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>

  • 相关阅读:
    tkinter中entry输入控件(四)
    tkinter中button按钮控件(三)
    tkinter中lable标签控件(二)
    tkinter简介(一)
    selenium中的xpath定位
    python实现邮件的发送
    python发送手机动态验证码
    selenium提供的截图功能
    selenium中浏览器及对应的驱动(可下载)
    PHP实现微信提现功能
  • 原文地址:https://www.cnblogs.com/moonfans/p/2985655.html
Copyright © 2011-2022 走看看