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
相关推荐
阿猿收手吧!2 分钟前
【C++】异步编程:std::async终极指南
开发语言·c++
小程故事多_8015 分钟前
Agent Infra核心技术解析:Sandbox sandbox技术原理、选型逻辑与主流方案全景
java·开发语言·人工智能·aigc
沐知全栈开发16 分钟前
SQL 日期处理指南
开发语言
黎雁·泠崖19 分钟前
【魔法森林冒险】3/14 Allen类(一):主角核心属性与初始化
java·开发语言
黎雁·泠崖23 分钟前
【魔法森林冒险】1/14 项目总览:用Java打造你的第一个回合制冒险游戏
java·开发语言
独好紫罗兰28 分钟前
对python的再认识-基于数据结构进行-a006-元组-拓展
开发语言·数据结构·python
C++ 老炮儿的技术栈32 分钟前
Qt 编写 TcpClient 程序 详细步骤
c语言·开发语言·数据库·c++·qt·算法
yuuki23323343 分钟前
【C++】继承
开发语言·c++·windows
222you43 分钟前
Redis的主从复制和哨兵机制
java·开发语言
牛奔1 小时前
如何理解 Go 的调度模型,以及 G / M / P 各自的职责
开发语言·后端·golang