<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></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: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);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>
<script src="../jquery-1.7.2.js"></script>
<script>
$(function(){
var points = $('#points'),
rount = $('#rount'),
rount2 = $('#rount2'),
num = $('#num'); points.change(function(){
var n =points.val();
num.text(n + '%');
if(n<=50){
rount.css('-webkit-transform','rotate(' + 3.6*n + 'deg)');
rount2.css('display','none');
}else{
rount.css('-webkit-transform','rotate(180deg)');
rount2.css('display','block');
rount2.css('-webkit-transform','rotate(' + 3.6*(n-50) + 'deg)');
}
})
}) </script>
</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>
<div class="points">
<span>0</span>
<input type="range" id="points" min="0" max="100" step="1" value="0">
<span>100</span>
</div>
</body>
</html>

测试结果:

CSS3绘制环形进度条的更多相关文章

  1. html5 canvas绘制环形进度条,环形渐变色仪表图

    html5 canvas绘制环形进度条,环形渐变色仪表图                                             在绘制圆环前,我们需要知道canvas arc() 方 ...

  2. canvas绘制环形进度条

    <!DOCTYPE html> <html > <head> <meta http-equiv="content-type" conten ...

  3. canvas 绘制环形进度条

    结果: 代码: <!DOCTYPE html> <html> <head lang="en"> <meta charset="U ...

  4. jQuery + CSS3实现环形进度条

    实现原理 原理非常的简单,在这个方案中,最主要使用了CSS3的transform中的rotate和CSS3的clip两个属性.用他们来实现半圆和旋转效果. 半环的实现 先来看其结构. HTML < ...

  5. CSS3实现环形进度条?

    两个对半矩形遮罩, 使用rotate以及overflow: hidden进行旋转

  6. iOS带动画的环形进度条(进度条和数字同步)

    本篇写的是实现环形进度条,并带动画效果,要实现这些,仅能通过自己画一个 方法直接看代码 为了方便多次调用,用继承UIView的方式 .m文件 #import <UIKit/UIKit.h> ...

  7. canvas环形进度条

    <style> canvas { border: 1px solid red; margin: 100px; }</style> <canvas id="rin ...

  8. iOS 环形进度条

    .h文件 #import <UIKit/UIKit.h> @interface YTProgressView : UIView@property (nonatomic, copy) NSS ...

  9. 环形进度条的实现方法总结和动态时钟绘制(CSS3、SVG、Canvas)

    缘由: 在某一个游戏公司的笔试中,最后一道大题是,“用CSS3实现根据动态显示时间和环形进度[效果如下图所示],且每个圆环的颜色不一样,不需要考虑IE6~8的兼容性”.当时第一想法是用SVG,因为SV ...

随机推荐

  1. django: form fileupload - 2

    继续介绍文件上传的第二种形式和第三种形式. ------------------------------------------------------------- 第二种形式较简单,直接用 DB ...

  2. 用ueditor上传图片、文件等到七牛云存储

    ueditor上传文件,是用数据流的形式上传的. 而七牛云存储官方文档中,只提供了文件路径上传的方式. 但是,仅仅是在官方文档中写了这一种方式. 事实上,利用VS的对象管理器,打开Qiniu的dll, ...

  3. _CrtMemBlockHeader

    typedef struct _CrtMemBlockHeader{// Pointer to the block allocated just before this one:struct _Crt ...

  4. 安卓java设置字体颜色

    textView03.setTextColor(this.getResources().getColor(R.color.botomfontColorUnSel));

  5. WebApi上传图片 await关键字

    await关键字对于方法执行的影响 将上一篇WebApi上传图片中代码修改(使用了await关键字)如下: [HttpPost] public async Task<string> Pos ...

  6. sql delete output

    select * into #student1 from student select * from #student1 create table #temp2( id int not null,na ...

  7. .NET知识点总结一(笔记整合)

    1.   .net framework原理简介,C#程序的两次编译 .NET源代码——>语言编译器(第一次编译)——>MSIL+元数据(exe文件)——>CLR(公共语言运行时——类 ...

  8. Caffe : Layer Catalogue(1)

    原文:http://caffe.berkeleyvision.org/tutorial/layers.html 参考:http://blog.csdn.net/u011762313/article/d ...

  9. android特效

    http://houxiyang.com/archives/89/ http://blog.csdn.net/hjj0212/article/details/8535817 http://www.li ...

  10. Linux Makefile自动生成--config.h

    Linux Makefile自动生成--config.h http://blog.csdn.net/spch2008/article/details/12510805