jQuery UI小部件无法找到包含的函数
我正在尝试创建一个简单的进度小部件。但是我得到了jQuery UI小部件无法找到包含的函数,jquery,jquery-ui,jquery-ui-widget,Jquery,Jquery Ui,Jquery Ui Widget,我正在尝试创建一个简单的进度小部件。但是我得到了\u showProgress并不是一次又一次的函数错误 (function ($, undefined) { $.widget("AOne.ProgressBar", { options: { max: 100, min: 0, current: 0, time: 1000, stepWidth: 1 }, innerDiv: $("<div></div>").css({ ove
\u showProgress
并不是一次又一次的函数错误
(function ($, undefined) {
$.widget("AOne.ProgressBar", {
options: { max: 100, min: 0, current: 0, time: 1000, stepWidth: 1 },
innerDiv: $("<div></div>").css({ overflow: 'hidden', clear: 'both',
height: '10px', width: '0px',
background: 'transparent url("Progress.gif") repeat-x
scroll left center' }).html(" "),
_create: function () {
this.element.append(this.innerDiv);
maxWidth = this.element.outerWidth();
this.options.stepWidth = maxWidth / this.options.max;
},
_init: function () {
this.intervalId = setInterval(function () {
this._showProgress();
},
this.options.time);
},
_showProgress: function () {
this.options.current += 1;
if (this.options.current < this.options.max) {
this.innerDiv.css({ width: this.options.stepWidth *
this.options.current + 'px' });
} else {
window.clearInterval(this.intervalId);
}
},
_setOption: function (key, value) {
$.Widget.prototype._setOption.apply(this, arguments);
},
destroy: function () {
$.Widget.prototype.destroy.call(this);
}
});
})(jQuery);
(函数($,未定义){
$.widget(“AOne.ProgressBar”{
选项:{max:100,min:0,current:0,time:1000,stepWidth:1},
innerDiv:$(“”).css({overflow:'hidden',clear:'both',
高度:“10px”,宽度:“0px”,
背景:透明url(“Progress.gif”)重复-x
向左中心滚动“}).html(“”),
_创建:函数(){
this.element.append(this.innerDiv);
maxWidth=this.element.outerWidth();
this.options.stepWidth=maxWidth/this.options.max;
},
_init:函数(){
this.intervalId=setInterval(函数(){
这个;
},
这是"选择,时间",;
},
_showProgress:函数(){
this.options.current+=1;
if(this.options.current
这可能是一个范围问题吗?试试这个:
_init: function () {
that = this;
this.intervalId = setInterval(function () {
that._showProgress();
},
this.options.time);
},