首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用rotator.js触发jquery加载器

如何使用rotator.js触发jquery加载器
EN

Stack Overflow用户
提问于 2014-09-29 15:50:21
回答 2查看 373关注 0票数 0

我正在使用这个带有百分比旋转器http://www.jqueryscript.net/rotator/Simple-jQuery-Circular-Loading-Bar-with-Percentage-Rotator.html的名为Simple jQuery循环加载条的插件

这个插件使用canvas标签来绘制圆圈,这个圆圈是在调用jquery函数时绘制的。如何才能在html页面上显示圆,并且只在jquery中调用百分比加载栏时才触发它。

下面是一个jsFiddle示例-- http://jsfiddle.net/fegvc5h8/

下面是代码

代码语言:javascript
复制
<!--html-->
<div id="rotator" style="height:100px;width:100px"></div>

//jquery
$(window).load(function () {
$("#rotator").rotator({
starting: 0,
ending: 100,
percentage: true,
color: 'green',
lineWidth: 7,
timer: 10,
radius: 40,
fontStyle: 'Calibri',
fontSize: '20pt',
fontColor: 'darkblue',
backgroundColor: 'lightgray',
callback: function () {
}
});       

});

EN

回答 2

Stack Overflow用户

发布于 2014-09-29 16:17:29

代码语言:javascript
复制
<div id="rotator" style="height:100px;width:100px"></div>
<input type="button" value="Fire" id="Fire">



$('#Fire').click(function () {
       Go();
});
function Go(){
 $("#rotator").rotator({
    starting: 0,
    ending: 100,
    percentage: true,
    color: 'green',
    lineWidth: 7,
    timer: 10,
    radius: 40,
    fontStyle: 'Calibri',
    fontSize: '20pt',
    fontColor: 'darkblue',
    backgroundColor: 'lightgray',
    callback: function () {
    }
    });
}



http://jsfiddle.net/fegvc5h8/5/
票数 1
EN

Stack Overflow用户

发布于 2014-09-29 16:41:02

我想你想要这样的东西

代码语言:javascript
复制
$('#sub').on('click', function () {
    val = $('#value').val()
    $("#rotator").rotator({
        ending: val
    })
})
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26094961

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档