ydn-js origin

YUI version 2.5.1

Locking one of the thumbs in a DualSlider

Challenge:

Support locking one of the DualSlider's thumbs at its current position while allowing the other thumb to move within the remaining range.

Solution:

DualSlider is a combination of two YAHOO.widget.Sliders that share the same background element. These Sliders are accessible via myDualSlider.minSlider and myDualSlider.maxSlider. Use the lock and unlock methods on one or both of these to lock the respective thumb.

Note: there is a bug in 2.5.1 DualSlider that causes the calculation of the distance between thumbs to be off for vertical DualSliders when the thumbs are not square. A patch is included inline. Also there are some bugs in 2.5.1 with respect to slider-background click behavior when one of the thumbs is locked. Patches for these are also included inline.