【发布时间】:2013-02-01 12:55:07
【问题描述】:
我正在使用spin.js 库来加载微调器。 Chrome 抛出此错误
[Uncaught ReferenceError: Spinner is not defined on]。
微调器在所有其他浏览器中都可以正常工作!
相关代码如下:
//Jquery Spinner
$.fn.spin = function(opts) {
this.each(function() {
var $this = $(this), data = $this.data();
if (data.spinner) {
data.spinner.stop();
delete data.spinner;
}
if (opts !== false) {
data.spinner = new Spinner($.extend({
color: $this.css('color')}, opts)).spin(this);
}
});
return this;
};
有什么解决办法吗?
【问题讨论】:
-
如果有任何代码或演示比它会更好回答
-
//Jquery Spinner $.fn.spin = function(opts) { this.each(function() { var $this = $(this), data = $this.data(); if (data.spinner) { data.spinner.stop(); 删除 data.spinner; } if (opts !== false) { data.spinner = new Spinner($.extend({color: $this.css('color ')}, opts)).spin(this); } });返回这个; };
标签: javascript jquery jquery-ui-spinner