eskimoblood / jim-knopf

:o: small JavaScript library to create knobs using SVG
http://eskimoblood.github.com/jim-knopf/
199 stars 44 forks source link

set initial value of knob #7

Closed stahlnow closed 9 years ago

stahlnow commented 9 years ago

Hello, I need advice in how to set the initial value when creating a knob. Also a simple callback example would help me.

HenningKlokkeraasen commented 9 years ago

Seems like initial value is always set to this.value = input.value = settings.min + settings.range / 2; in the Knob definition. If you modify it to be just this.value = input.value; that should do it. Worked in my project. Also you would have to set the attribute value="123" on the input element

eskimoblood commented 9 years ago

Just set the value of the input HTML element before creating the knob

HenningKlokkeraasen commented 9 years ago

I'm not sure that will work since this seem to set it to something else: this.value = input.value = settings.min + settings.range / 2;