JQuery ручка трон проблема с кожей

Если кто-то использовал этот плагин раньше:

https://github.com/aterrien/jQuery-Knob

я пытаюсь нанести скин: "трон"

пытался добавить <input data-skin="tron"> но не работает, также попытался в коде инициализации:

$(".dial").knob({       
        readOnly:true,
        thickness:0.05,
        width:100,
        fgColor:"#cc0000",
        bgColor:"#ccc",
        skin:"tron"

        });

кто-нибудь знает, что может быть не так?

2 ответа

Решение

На всякий случай, если кто-то ищет тот же ответ, попробуйте это, найденное на демонстрационной странице, но почему этот код не включен в исходный скрипт!

включите это как опцию в метод knob:

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;
                        }
                    }

Даже если это очень поздний ответ, вы можете использовать плагин jQuery roundSlider, где вы можете получить скин tron ​​с простой настройкой CSS.

Проверьте ниже демо:

Demo - JSFiddle

Скриншот: JavaScript плагин roundSlider с троном

Другие вопросы по тегам