Constructor
new Slider(container, oopt)
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
container |
object | DOM container for the widget. | |||||||||||||||||||||||||||||||
o |
object |
<optional> |
Options.
Properties
|
Methods
_calcMovePrecision()
Calculates the precision with which the state value changes when moved.
(private) _calcSliderBodyHeight() → {number}
Returns the height of the slider body.
Returns:
- Height of the slider body.
- Type
- number
(private) _calcSliderBodyPos() → {object}
Returns the position and dimensions for the slider body.
Returns:
- {x, y} position.
- Type
- object
(private) _calcSliderBodyWidth() → {number}
Returns the height of the slider body.
Returns:
- Width of the slider body.
- Type
- number
(private) _calcSliderHandlePoints() → {object}
Returns the position and dimensions for the slider body.
Returns:
- {x, y} position.
- Type
- object
(private) _calcTouchVal(y) → {number}
Calculate the value of the slider touched at position y.
Parameters:
| Name | Type | Description |
|---|---|---|
y |
number | Y-value of the touch location. |
Returns:
- Value of the slider at the touched location.
- Type
- number
(protected) _initHandlers()
Initialize mouse and touch event handlers
(protected) _initOptions()
Initialize the options
(protected) _initState()
Initialize state.
(protected) _initStateConstraints()
Initialize state constraints
(protected) _initSvgEls()
Initialize the svg elements
(protected) _update()
Update (redraw) component based on state
getVal()
Get the slider value.
setInternalVal(newVal)
Set the current slider value.
Same as setVal(), but will not cause an observer callback trigger.
Parameters:
| Name | Type | Description |
|---|---|---|
newVal |
number | The new slider value. |
setVal(newVal)
Set the current slider value.
Same as setInternalVal(), but will cause an observer callback trigger.
Parameters:
| Name | Type | Description |
|---|---|---|
newVal |
number | The new slider value. |