boolean |
animate
Flag that determines if the thumb will animate when moved
|
Slider |
thumb
a YAHOO.widget.SliderThumb instance that we will use to
reposition the thumb when the background is clicked
|
int |
tickPause
Adjustment factor for tick animation, the more ticks, the
faster the animation (by default)
|
boolean |
ANIM_AVAIL
By default, animation is available if the animation library is detected.
|
Class YAHOO.widget.Slider
Object | +--YAHOO.util.DragDrop | +--YAHOO.widget.Slider
class
YAHOO.widget.Slider
Field Summary [top]
Constructor Summary [top]
YAHOO.widget.Slider
A DragDrop implementation that can be used as a background for a
slider.
Method Summary [top]
int |
getValue
()
Returns the slider's thumb offset from the start position
|
int |
getXValue
()
Returns the slider's thumb X offset from the start position
|
int |
getYValue
()
Returns the slider's thumb Y offset from the start position
|
void |
lock
()
Lock the slider, overrides YAHOO.util.DragDrop
|
void |
onChange
(firstOffset, secondOffset)
Event that fires when the value of the slider has changed
|
void |
onSlideEnd
()
Event that fires at the end of a slider thumb move
|
void |
onSlideStart
()
Event that fires when the at the beginning of the slider thumb move
|
boolean |
setRegionValue
(<int> newOffset, <int> newOffset2, <boolean> skipAnim)
Provides a way to set the value of the region slider in code.
|
void |
setStartSliderState
()
|
boolean |
setValue
(<int> newOffset, <boolean> skipAnim, <boolean> force)
Provides a way to set the value of the slider in code.
|
void |
unlock
()
Unlock the slider, overrides YAHOO.util.DragDrop
|
boolean |
verifyOffset
()
Checks the background position element position.
|
Slider |
getHorizSlider
(<String> sBGElId, <String> sHandleElId, <int> iLeft, <int> iRight, <int> iTickSize)
Factory method for creating a horizontal slider
|
Slider |
getSliderRegion
(<String> sBGElId, <String> sHandleElId, <int> iLeft, <int> iRight, <int> iUp, <int> iDown, <int> iTickSize)
Factory method for creating a slider region like the one in the color
picker example
|
Slider |
getVertSlider
(<String> sBGElId, <String> sHandleElId, <int> iUp, <int> iDown, <int> iTickSize)
Factory method for creating a vertical slider
|
Field Detail [top]
animate
boolean
animate
Flag that determines if the thumb will animate when moved
thumb
Slider
thumb
a YAHOO.widget.SliderThumb instance that we will use to
reposition the thumb when the background is clicked
tickPause
int
tickPause
Adjustment factor for tick animation, the more ticks, the
faster the animation (by default)
ANIM_AVAIL
boolean
ANIM_AVAIL
By default, animation is available if the animation library is detected.
Constructor Detail [top]
YAHOO.widget.Slider
YAHOO.widget.Slider
()
A DragDrop implementation that can be used as a background for a
slider. It takes a reference to the thumb instance
so it can delegate some of the events to it. The goal is to make the
thumb jump to the location on the background when the background is
clicked.
- Parameters:
-
id
- the id of the element linked to this instance -
sGroup
- the group of related DragDrop items
Method Detail [top]
getValue
int
getValue
()
Returns the slider's thumb offset from the start position
- Returns:
- the current value
getXValue
int
getXValue
()
Returns the slider's thumb X offset from the start position
- Returns:
- the current horizontal offset
getYValue
int
getYValue
()
Returns the slider's thumb Y offset from the start position
- Returns:
- the current vertical offset
lock
void
lock
()
Lock the slider, overrides YAHOO.util.DragDrop
onChange
void
onChange
(firstOffset, secondOffset)
Event that fires when the value of the slider has changed
- Parameters:
-
offsetFromStart
- the number of pixels the thumb has moved from its start position
onSlideEnd
void
onSlideEnd
()
Event that fires at the end of a slider thumb move
onSlideStart
void
onSlideStart
()
Event that fires when the at the beginning of the slider thumb move
setRegionValue
boolean
setRegionValue
(<int> newOffset, <int> newOffset2, <boolean> skipAnim)
Provides a way to set the value of the region slider in code.
- Parameters:
-
newOffset
- the number of pixels the thumb should be positioned away from the initial start point -
newOffset2
- the number of pixels the thumb should be positioned away from the initial start point (y axis for region) -
skipAnim
- set to true to disable the animation for this move action (but not others). -
force
- ignore the locked setting and set value anyway
- Returns:
- true if the move was performed, false if it failed
setStartSliderState
void
setStartSliderState
()
setValue
boolean
setValue
(<int> newOffset, <boolean> skipAnim, <boolean> force)
Provides a way to set the value of the slider in code.
- Parameters:
-
newOffset
- the number of pixels the thumb should be positioned away from the initial start point -
skipAnim
- set to true to disable the animation for this move action (but not others). -
force
- ignore the locked setting and set value anyway
- Returns:
- true if the move was performed, false if it failed
unlock
void
unlock
()
Unlock the slider, overrides YAHOO.util.DragDrop
verifyOffset
boolean
verifyOffset
()
Checks the background position element position. If it has moved from the
baseline position, the constraints for the thumb are reset
- Returns:
- True if the offset is the same as the baseline.
getHorizSlider
Slider
getHorizSlider
(<String> sBGElId, <String> sHandleElId, <int> iLeft, <int> iRight, <int> iTickSize)
Factory method for creating a horizontal slider
- Parameters:
-
sBGElId
- the id of the slider's background element -
sHandleElId
- the id of the thumb element -
iLeft
- the number of pixels the element can move left -
iRight
- the number of pixels the element can move right -
iTickSize
- optional parameter for specifying that the element should move a certain number pixels at a time.
- Returns:
- a horizontal slider control
getSliderRegion
Slider
getSliderRegion
(<String> sBGElId, <String> sHandleElId, <int> iLeft, <int> iRight, <int> iUp, <int> iDown, <int> iTickSize)
Factory method for creating a slider region like the one in the color
picker example
- Parameters:
-
sBGElId
- the id of the slider's background element -
sHandleElId
- the id of the thumb element -
iLeft
- the number of pixels the element can move left -
iRight
- the number of pixels the element can move right -
iUp
- the number of pixels the element can move up -
iDown
- the number of pixels the element can move down -
iTickSize
- optional parameter for specifying that the element should move a certain number pixels at a time.
- Returns:
- a slider region control
getVertSlider
Slider
getVertSlider
(<String> sBGElId, <String> sHandleElId, <int> iUp, <int> iDown, <int> iTickSize)
Factory method for creating a vertical slider
- Parameters:
-
sBGElId
- the id of the slider's background element -
sHandleElId
- the id of the thumb element -
iUp
- the number of pixels the element can move up -
iDown
- the number of pixels the element can move down -
iTickSize
- optional parameter for specifying that the element should move a certain number pixels at a time.
- Returns:
- a vertical slider control