zoukankan      html  css  js  c++  java
  • 20150621进度条

    <div id="a">
        <div id="b">0%</div>
        <div id="c">0%</div>
    </div>
    
    
    #a{ 300px;height: 40px;line-height: 40;position: relative;border: 1px solid black;}
    #b{background: blue;z-index: 2;position: absolute;left: 0;top: 0;clip:rect(0px 0px 40px 0px); 100%;height: 40px;line-height: 40px;color:white;text-align: center;}
    #c{ :100%;height: 40px;line-height: 40px;text-align: center;}
    
    
    window.onload=function () {
        var iNow=5;
        var timer=setInterval(function () {
            if(iNow==100){
                clearInterval(timer);
            }else{
                iNow+=5;
                move(iNow)
            }
        },50);
        var a=document.getElementById('a');
        var b=document.getElementById('b');
        var c=document.getElementById('c');
        function move(n) {
            b.innerHTML=n+'%';
            c.innerHTML=n+'%';
            b.style.clip='rect(0px '+(n/100)*300+'px 40px 0px)'        
        }
    }
  • 相关阅读:
    高二下期末考试
    LG月赛.7
    CF1187E
    P5440 【XR-2】奇迹
    P1084 疫情控制
    P1083 借教室
    P2680 运输计划
    P3128 [USACO15DEC]最大流Max Flow
    博弈入门
    HDU 1907
  • 原文地址:https://www.cnblogs.com/wz0107/p/4591497.html
Copyright © 2011-2022 走看看