进度条-环


<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css3环形进度条</title>
<style>
*{margin: 0;padding: 0;}
.box{200px;height:200px;margin:10px auto;position:relative;}
.box div{position:absolute;top:0;left:0;border-radius:50%;height:160px;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:green 20px solid;clip:rect(0,100px,200px,0);-webkit-transform:rotate(0deg);}
.box .rount2{border:green 20px solid;clip:rect(0,200px,200px,100px);-webkit-transform:rotate(0deg);}
.box .num{font:bold 24px/160px tahoma;text-align:center;color:green;top:20px;left:20px;z-index:9;}
.points{200px;margin:10px auto;text-align: center;}
</style>
</head>
<script></script>
<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">50%</div>
</div>
<div class="points">
<input type="range" id="points" min="0" max="100" step="1" value="" />


</body>
</html>
<style>.weeeb{
display:block;
192px;
height:70px; background:url(http://sandbox.runjs.cn/uploads/rs/29/y5xcbrne/logo.gif);
position:fixed;
_position:absolute;
right:20px;
bottom:20px;
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
opacity:0.4;
filter:alpha(opacity=40);
text-indent:-9999em;
z-index:9;
}
.weeeb:hover{
opacity:1;
filter:alpha(opacity=100);
}</style>
<script>
window.onload=function(){
function round(){
var points = document.getElementById('points'),
num = document.getElementById('num');
rount = document.getElementById('rount'),
rount2 = document.getElementById('rount2'),

points.onchange=function(){
var n =points.value;
num.innerHTML = n + "%";
if(n<=50){
rount.style.webkitTransform="rotate(" + 3.6*n + "deg)";
rount2.style.display="none";
}else{
rount.style.webkitTransform="rotate(180deg)";
rount2.style.display="block";
rount2.style.webkitTransform="rotate(" + 3.6*(n-50) + "deg)";
}
};
}
round();
}

</script>


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

</style>
</head>
<script></script>
<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">50%</div>
</div>
<div class="points">
<input id="points" min="0" max="100" step="1" value="" />

</div>
</body>
</html>

<script>
window.onload=function(){
function round(){
var points = document.getElementById('points'),
num = document.getElementById('num');
rount = document.getElementById('rount'),
rount2 = document.getElementById('rount2'),

points.onchange=function(){
var n =points.value;
num.innerHTML = n + "%";
if(n<=50){
rount.style.webkitTransform="rotate(" + 3.6*n + "deg)";
rount2.style.display="none";
}else{
rount.style.webkitTransform="rotate(180deg)";
rount2.style.display="block";
rount2.style.webkitTransform="rotate(" + 3.6*(n-50) + "deg)";
}
};
}
round();
}

</script>

<script></script>
<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"></div>
</div>
<div class="points">
<input id="points" min="0" max="100" step="1" value="55" />
</div>
</body>
</html>

<script>
window.onload=function(){
function round(){
var points = document.getElementById('points'),
num = document.getElementById('num');
rount = document.getElementById('rount'),
rount2 = document.getElementById('rount2');


var n =points.value;
num.innerHTML = n + "%";
if(n<=50){
rount.style.webkitTransform="rotate(" + 3.6*n + "deg)";
rount2.style.display="none";
}else{
rount.style.webkitTransform="rotate(180deg)";
rount2.style.display="block";
rount2.style.webkitTransform="rotate(" + 3.6*(n-50) + "deg)";
}

}
round();
}

</script>

原文地址:https://www.cnblogs.com/wzzl/p/4590602.html