circleProgress.js圆环进度条插件

<script src="jquery.min.js"></script>
<script src="jquery-circle-progress/dist/circle-progress.js"></script>

<div id="circle"></div>

<script>
    $('#circle').circleProgress({
        value: 0.75,
        size: 80,
        fill: {
            gradient: ["red", "orange"]
        }
    });
</script>

选项:

Option Description
value 必须值,圆环的百分比从0到1. 默认值: 0
size 圆环大小 Default: 100
startAngle 初始角度 Default: -Math.PI
reverse 是否逆时针 Default: false
thickness 圆环的宽度,默认为1/4的大小 Default: "auto"
lineCap Arc line cap: "butt", "round" or "square" - read more Default: "butt"
fill 圆环的填充颜色 - { color: "#ff1e41" } - { color: 'rgba(255, 255, 255, .3)' } - { gradient: ["red", "green", "blue"] } - { gradient: [["red", .2], ["green", .3], ["blue", .8]] } - { gradient: [ ... ], gradientAngle: Math.PI / 4 } - { gradient: [ ... ], gradientDirection: [x0, y0, x1, y1] } - { image: "http://i.imgur.com/pT0i89v.png" } - { image: imageInstance } - { color: "lime", image: "http://i.imgur.com/pT0i89v.png" } Default: { gradient: ["#3aeabb", "#fdd250"] }
emptyFill 空白的圆环 Default: "rgba(0, 0, 0, .1)"
animation 动画设置 See jQuery animations. You may also set it to false Default: { duration: 1200, easing: "circleProgressEase" } "circleProgressEase" is just a ease-in-out-cubic easing
animationStartValue 动画默认开始从那个值开始运动。 Default: 0.0

事件

Event Handler
circle-animation-start function(event): - event - jQuery event
circle-animation-progress function(event, animationProgress, stepValue): - event - jQuery event - animationProgress - from 0.0 to 1.0 - stepValue - current step value: from 0.0 to value
circle-animation-end function(event): - event - jQuery event

其他:

You can get the <canvas> (but only if the widget is already inited):

复制代码
$('#circle').circleProgress({ value: 0.5 });
var canvas = $('#circle').circleProgress('widget');

You can get the CircleProgress instance:

复制代码
var instance = $('#circle').data('circle-progress');

You can redraw existing circle (but only if the widget is already inited):

复制代码
$('#circle').circleProgress({ value: 0.5, fill: { color: 'orange' }});
$('#circle').circleProgress('redraw'); // use current configuration and redraw
$('#circle').circleProgress(); // alias for 'redraw'
$('#circle').circleProgress({ size: 150 }); // set new size and redraw
相关推荐
Jiaberrr4 分钟前
前端实战:使用JS和Canvas实现运算图形验证码(uniapp、微信小程序同样可用)
前端·javascript·vue.js·微信小程序·uni-app
everyStudy28 分钟前
JS中判断字符串中是否包含指定字符
开发语言·前端·javascript
luthane30 分钟前
python 实现average mean平均数算法
开发语言·python·算法
Ylucius37 分钟前
动态语言? 静态语言? ------区别何在?java,js,c,c++,python分给是静态or动态语言?
java·c语言·javascript·c++·python·学习
凡人的AI工具箱1 小时前
AI教你学Python 第11天 : 局部变量与全局变量
开发语言·人工智能·后端·python
200不是二百1 小时前
Vuex详解
前端·javascript·vue.js
sleP4o1 小时前
Python操作MySQL
开发语言·python·mysql
是店小二呀1 小时前
【C++】C++ STL探索:Priority Queue与仿函数的深入解析
开发语言·c++·后端
LvManBa1 小时前
Vue学习记录之三(ref全家桶)
javascript·vue.js·学习
洛寒瑜1 小时前
【读书笔记-《30天自制操作系统》-23】Day24
开发语言·汇编·笔记·操作系统·应用程序