jQuery-Knob
jQuery-Knob copied to clipboard
format definition is not easy to use
I would like to have in hmtl code the format and the unit to be set (like angleOffset, fgColor, step...):
<input data-unit='min'... data-format="x/60'>
but it is not handled nby knob.
I made some little modification of the orignal code so I can retrieve those information in my javascript knob definition :
let say v is in seconds and I want to display minutes
format : function(v){ var unit=this.unit; var format=this.format; var newv=eval(formulaDisplay.replace("x",v)); return newv+unit; }
What do you think of this improvement? We could also add data1, data2, data3 to allow free additionnal data if needed.