Constructor
new RangeElement(parentnon-null, controlsnon-null, containerClassNamesnon-null, barClassNamesnon-null, enableWheelopt)
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
parent |
HTMLElement
|
|
|
|
controls |
shaka.ui.Controls
|
|
|
|
containerClassNames |
Array<string>
|
|
|
|
barClassNames |
Array<string>
|
|
|
|
enableWheel |
boolean
|
<optional>
|
false
|
|
- Implements:
- Source:
Members
bar :HTMLInputElement
Type:
- Implements:
- Source:
container :HTMLElement
This container is to support IE 11. See detailed notes in
less/range_elements.less for a complete explanation.
Type:
- Implements:
- Source:
isChanging_ :boolean
Type:
- Source:
isMouseChanging_ :boolean
Type:
- Source:
Methods
changeTo(value)
Called to implement keyboard-based changes, where this is no clear "end".
This will simulate events like onChangeStart(), onChange(), and
onChangeEnd() as appropriate.
Parameters:
| Name |
Type |
Description |
value |
number
|
|
- Implements:
- Source:
getMax() → {number}
- Implements:
- Source:
Returns:
-
Type
-
number
getMin() → {number}
- Implements:
- Source:
Returns:
-
Type
-
number
getValue() → {number}
- Implements:
- Source:
Returns:
-
Type
-
number
getValueFromPosition(clientX) → {number}
Converts an X position within the element into a range input value.
Parameters:
| Name |
Type |
Description |
clientX |
number
|
|
- Source:
Returns:
-
Type
-
number
onChange()
Called when a new value is set by user interaction.
To be overridden by subclasses.
- Implements:
- Source:
onChangeEnd()
Called when user interaction ends.
To be overridden by subclasses.
- Implements:
- Source:
onChangeStart()
Called when user interaction begins.
To be overridden by subclasses.
- Implements:
- Source:
onWheel_(eventnon-null)
Handle mouse wheel input to control the range value.
Parameters:
| Name |
Type |
Description |
event |
WheelEvent
|
|
- Source:
setBackground(background)
Parameters:
| Name |
Type |
Description |
background |
string
|
|
- Implements:
- Source:
Synchronize the mouse position with the range value.
Parameters:
| Name |
Type |
Description |
event |
Event
|
|
- Source:
setBarValueForTouch_(event)
Synchronize the touch position with the range value.
Comes in handy on iOS, where users have to grab the handle in order
to start seeking.
Parameters:
| Name |
Type |
Description |
event |
Event
|
|
- Source:
setRange(min, max)
Parameters:
| Name |
Type |
Description |
min |
number
|
|
max |
number
|
|
- Implements:
- Source:
setStep(step)
Parameters:
| Name |
Type |
Description |
step |
number
|
string
|
|
- Implements:
- Source:
setValue(value)
Parameters:
| Name |
Type |
Description |
value |
number
|
|
- Implements:
- Source: