Class: Slider

Slider(container, oopt)

Class representing a Slider widget.

Constructor

new Slider(container, oopt)

Parameters:
Name Type Attributes Description
container object DOM container for the widget.
o object <optional>
Options.
Properties
Name Type Attributes Default Description
minVal number <optional>
0 The minimum possible value the slider can represent.
maxVal number <optional>
127 The maximum possible value teh slider can represent.
step number <optional>
1 Step granularity.
sliderBodyColor string <optional>
"#484848" The color of the slider bar.
sliderHandleColor string <optional>
"#484848" The color of the triangle used as the slider's needle.
Implements:
  • Widget
Source:

Methods

_calcMovePrecision()

Calculates the precision with which the state value changes when moved.
Source:

(private) _calcSliderBodyHeight() → {number}

Returns the height of the slider body.
Source:
Returns:
- Height of the slider body.
Type
number

(private) _calcSliderBodyPos() → {object}

Returns the position and dimensions for the slider body.
Source:
Returns:
- {x, y} position.
Type
object

(private) _calcSliderBodyWidth() → {number}

Returns the height of the slider body.
Source:
Returns:
- Width of the slider body.
Type
number

(private) _calcSliderHandlePoints() → {object}

Returns the position and dimensions for the slider body.
Source:
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.
Source:
Returns:
- Value of the slider at the touched location.
Type
number

(protected) _initHandlers()

Initialize mouse and touch event handlers
Source:

(protected) _initOptions()

Initialize the options
Source:

(protected) _initState()

Initialize state.
Source:

(protected) _initStateConstraints()

Initialize state constraints
Source:

(protected) _initSvgEls()

Initialize the svg elements
Source:

(protected) _update()

Update (redraw) component based on state
Source:

getVal()

Get the slider value.
Source:

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.
Source:

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.
Source: