Yahoo! UI Library

Slider Widget  2.5.2

Yahoo! UI Library > slider > YAHOO.widget.DualSlider

Show Private Show Protected

Class YAHOO.widget.DualSlider - uses YAHOO.util.EventProvider

A slider with two thumbs, one that represents the min value and the other the max. Actually a composition of two sliders, both with the same background. The constraints for each slider are adjusted dynamically so that the min value of the max slider is equal or greater to the current value of the min slider, and the max value of the min slider is the current value of the max slider. Constructor assumes both thumbs are positioned absolutely at the 0 mark on the background.

Constructor

YAHOO.widget.DualSlider ( minSlider , maxSlider , range , initVals )
Parameters:
minSlider <Slider> The Slider instance used for the min value thumb
maxSlider <Slider> The Slider instance used for the max value thumb
range <int> The number of pixels the thumbs may move within
initVals <Array> (optional) [min,max] Initial thumb placement

Properties

activeSlider - Slider

The currently active slider (min or max). read only

isHoriz - boolean

Is the DualSlider oriented horizontally or vertically? read only

maxSlider - Slider

A slider instance that keeps track of the upper value of the range. read only

maxVal - int

The current value of the max thumb. read only.

minRange - int

Pixel distance to maintain between thumbs.
Default Value: 0

minSlider - Slider

A slider instance that keeps track of the lower value of the range. read only

minVal - int

The current value of the min thumb. read only.

Methods

setMaxValue

void setMaxValue ( max , skipAnim , force , silent )
Set the max thumb position to a new value.
Parameters:
max <int> Pixel offset for max thumb
skipAnim <boolean> (optional) Set to true to skip thumb animation. Default false
force <boolean> (optional) ignore the locked setting and set value anyway. Default false
silent <boolean> (optional) Set to true to skip firing change events. Default false
Returns: void

setMinValue

void setMinValue ( min , skipAnim , force , silent )
Set the min thumb position to a new value.
Parameters:
min <int> Pixel offset for min thumb
skipAnim <boolean> (optional) Set to true to skip thumb animation. Default false
force <boolean> (optional) ignore the locked setting and set value anyway. Default false
silent <boolean> (optional) Set to true to skip firing change events. Default false
Returns: void

setValues

void setValues ( min , max , skipAnim , force , silent )
Sets the min and max thumbs to new values.
Parameters:
min <int> Pixel offset to assign to the min thumb
max <int> Pixel offset to assign to the max thumb
skipAnim <boolean> (optional) Set to true to skip thumb animation. Default false
force <boolean> (optional) ignore the locked setting and set value anyway. Default false
silent <boolean> (optional) Set to true to skip firing change events. Default false
Returns: void

Events

change

change ( dualslider )
Event that fires when either the min or max value changes
Parameters:
dualslider <DualSlider> the DualSlider instance

ready

ready ( dualslider )
Event that fires when the slider is finished setting up
Parameters:
dualslider <DualSlider> the DualSlider instance

slideEnd

slideEnd ( activeSlider )
Event that fires when one of the thumbs finishes moving
Parameters:
activeSlider <Slider> the moving slider

slideStart

slideStart ( activeSlider )
Event that fires when one of the thumbs begins to move
Parameters:
activeSlider <Slider> the moving slider


Copyright © 2007 Yahoo! Inc. All rights reserved.