圆圈进度条

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>css3环形进度条</title>
        <style>
            *{margin: 0;padding: 0;}
            .box{width:200px;height:200px;margin:10px auto;position:relative;}
            .box div{position:absolute;top:0;left:0;border-radius:50%;height:160px;width:160px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;}
            .box .bg{border:silver 20px solid}
            .box .bg2{border:silver 20px solid;clip:rect(0,100px,200px,0);}
            .box .rount{border:red 20px solid;clip:rect(0,100px,200px,0);-webkit-transform:rotate(0deg);}
            .box .rount2{border:red 20px solid;clip:rect(0,200px,200px,100px);-webkit-transform:rotate(0deg);display:none}
            .box .num{font:bold 24px/160px tahoma;text-align:center;color:green;top:20px;left:20px;z-index:9;}
            .points{width:200px;margin:10px auto;text-align: center;}
        </style>
    </head>


    <body>
        <div class="box">
            <div class="bg"></div>
            <div id="rount" class="rount"></div>
            <div class="bg2"></div>
            <div id="rount2" class="rount2"></div>
            <div id="num" class="num">0</div>
        </div>
    </body>


    <script>


     var  rount = document.getElementById('rount');
     var rount2 = document.getElementById('rount2');
     var num = document.getElementById('num');
     var value=0;
     function round(){
        value++;
        num.innerHTML = value + "%";
        if(value<=50){
            rount.style.webkitTransform="rotate(" + 3.6*value + "deg)";
            rount2.style.display="none";
        }else{
            rount.style.webkitTransform="rotate(180deg)";
            rount2.style.display="block";
            rount2.style.webkitTransform="rotate(" + 3.6*(value-50) + "deg)";
        }
        setTimeout(round,100);
    }
    round();
</script>
</html>




<!-- Generated by RunJS (Thu Apr 14 22:03:22 CST 2016) 0ms -->
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值