aterrien / jQuery-Knob

Nice, downward compatible, touchable, jQuery dial
http://anthonyterrien.com/knob/
MIT License
5.03k stars 1.24k forks source link

Can I use an array of values? #346

Closed tracs closed 7 years ago

tracs commented 7 years ago

Can I use an array of values on my knob? Like: 20,30,60,100,200,400,800

tracs commented 7 years ago

Solved by:

var values = [20, 30, 60, 100, 200, 400, 800];

$(".foo").knob({ min: 0, max: values.length - 1, step: 1, format: function(v) { return values[v]; } });