Sliders use DOM position offsets to calculate value. The initial offsets are calculated at instantiation. If the Slider is instantiated in a hidden container, the initial offsets are stored as
NaN, resulting in all further calculations returning
There are three methods to create Sliders with functional offset calculations:
resetConstraintsmethod and the Slider's
setStartSliderStatewhen the container is displayed
verifyOffsetmethod to account for incorrectly initialized offsets
Each of these approaches has its drawbacks (noted in the code below).
DualSlider additionally needs some code patches to facilitate correcting its reference values (for options #2 and #3).
Caveat: Attempts to
setValue will still fail (return
NaN) as long as the Slider is not displayed.