如果有人之前使用过这个插件:
https://github.com/aterrien/jQuery-Knob
我试图涂抹皮肤:“tron”
试图添加<input data-skin="tron">
但是没有用,也尝试过初始化代码:
$(".dial").knob({
readOnly:true,
thickness:0.05,
width:100,
fgColor:"#cc0000",
bgColor:"#ccc",
skin:"tron"
});
谁知道什么可能出错?
答案 0 :(得分:14)
以防万一有人在寻找相同的答案,应该试试这个,在演示页面中找到,不要为什么这些代码不包含在源脚本中呢!
在旋钮方法中包含此选项:
draw : function () {
// "tron" case
if(this.$.data('skin') == 'tron') {
this.cursorExt = 0.3;
var a = this.arc(this.cv) // Arc
, pa // Previous arc
, r = 1;
this.g.lineWidth = this.lineWidth;
if (this.o.displayPrevious) {
pa = this.arc(this.v);
this.g.beginPath();
this.g.strokeStyle = this.pColor;
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, pa.s, pa.e, pa.d);
this.g.stroke();
}
this.g.beginPath();
this.g.strokeStyle = r ? this.o.fgColor : this.fgColor ;
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, a.s, a.e, a.d);
this.g.stroke();
this.g.lineWidth = 2;
this.g.beginPath();
this.g.strokeStyle = this.o.fgColor;
this.g.arc( this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
this.g.stroke();
return false;
}
}
答案 1 :(得分:1)