You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new dial instance, linked to inputEl. May also pass in an options object, details in options section. Upon instantiation, the dial is rendered, the input is hidden, and events are bound to the dial.
If val is within the allowed range, it is set on the input field and the dial is updated accordingly. A change event is fired with the val passed in as the only argument.
Dial#render()
Reconstructs the dial's el property containing the dial element. Already called during instantiation.
Dial#bind()
Binds events necessary for the dial -- also binds mouseup and mousemove to document if this is the first dial. Already called during instantiation.
Dial#unbind()
Unbinds the events related to the dial.
Dial#hideInput()
Hides the corresponding input field. Already called on instantiation.
Dial#showInput()
Displays the corresponding input field. Called on destroy, or call it manually to display the element.
Dial#destroy()
Destroys the dials element, reveals original input element and unbinds dial events
Events
Dial inherits from Emitter, so all emitter methods apply. By default, only a change event is fired when the dial's value changes, which can be hooked into via:
vardial=newDial(input);dial.on('change',function(val){console.log('Dial value is now: '+val);});
Options
Configuration options can be set up via the option object in the constructor, data attributes in the input element, or by default -- this is also the order in which they're checked on a property by property basis.