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
相关推荐
摘星编程4 分钟前
React Native for OpenHarmony 实战:Swiper 滑动组件详解
javascript·react native·react.js
workflower6 分钟前
软件需求规约的质量属性
java·开发语言·数据库·测试用例·需求分析·结对编程
鸣弦artha21 分钟前
Flutter框架跨平台鸿蒙开发——Build流程深度解析
开发语言·javascript·flutter
情缘晓梦.35 分钟前
C++ 内存管理
开发语言·jvm·c++
黄晓琪35 分钟前
Java AQS底层原理:面试深度解析(附实战避坑)
java·开发语言·面试
姓蔡小朋友1 小时前
Java 定时器
java·开发语言
百锦再1 小时前
python之路并不一马平川:带你踩坑Pandas
开发语言·python·pandas·pip·requests·tools·mircro
灏瀚星空1 小时前
基于 Python 与 GitHub,打造个人专属本地化思维导图工具全流程方案(上)
开发语言·人工智能·经验分享·笔记·python·个人开发·visual studio
是Dream呀1 小时前
Python从0到100(一百):基于Transformer的时序数据建模与实现详解
开发语言·python·transformer
草莓熊Lotso1 小时前
Python 入门超详细指南:环境搭建 + 核心优势 + 应用场景(零基础友好)
运维·开发语言·人工智能·python·深度学习·学习·pycharm