js 进度条

radialIndicator是一款轻量级的jQuery 圆形指示器插件


参数名称参数类型默认值描述
radiusnumber50定义圆形指示器的内部的圆的半径。
barWidthnumber5定义圆形指示器的刻度条的宽度。
barBgColorcolour code in hex#eeeeee定义圆形指示器的刻度条的背景颜色。
barColorobject of colour range like ({0 : '#FF0000', 50 : '#FFFF00', 100 : '#0066FF',}) or color code in hex#99CC33定义渊声巷指示器的刻度条颜色。如果提供一个颜色范围对象作为值,插件会将该范围的颜色插入(如果 interpolate选项为true)在指定的位置。
roundCornerbooleanfalse如果设置为true则圆形指示器的刻度bar有圆角。
format# format like (##,###,###) or a formatter function##Define # format or formatter function to format indicator number.
frameNumnumber100 for percentage and 500 for othersNumber of frames in which indcator circle is divided.
frameTimenumber10Time taken to go from one frame to another.
fontColorhex color codecolor code of progressBy default it takes the color code of progress at specific point. If defined it will take the defined color code.
fontSizenumberCalculated默认情况下字体大小是适合于圆形指示器的内圆。定义这个参数可以覆盖它。
fontFamilyfont family similiar to per css syntaxdefault定义圆形指示器的数值的字体。
fontWeightfont weight similiar to css syntaxbold定义圆形指示器的数值的字体weight。
interpolatebooleantrue
percentagebooleantrue设置为true显示圆形指示器的百分比数值。
displayNumberbooleantrue设置为true显示圆形指示器的刻度数值。
initValuenumberminValue or 0圆形指示器初始化的值。
minValuenumber0圆形指示器的最小值。
maxValuenumber100


举例:

css

.syRightBox{ padding-right:1rem;}
.syRightBox canvas{}
#indicatorContainer{ width:5rem; height:5rem; margin-right:2rem;}

页面

<div class="syRightBox" id="indicatorContainer"></div>

<script type="text/javascript">

jquery

$("#indicatorContainer").radialIndicator({

                        barColor: '#d01111',
                        barWidth: 8,
                        initValue: 50,
                        percentage: true

 })

</script>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值