slider help - need to move other handle when one handle is moved
I have a slider that has one or two handles depending on some
settings. When there are two handles, I would like to maintain a
minimum range between them. So if I have a scale from 0 - 100, two
handles, "low" and "high", with minimum range 10, when I'm sliding
"low" towards "high" if abs("high" - "low") < minimum range, I want
"high" to move higher. If "high" = 100, then I want "low" to have a
max of 100 - 10. Similarly, if "high" is being moved close to "low" I
want "low" to move lower but not lower than 0 and therefore, "high"
shouldn't be lower than 10.
Due to the dynamic nature of the slider I can't use the range=true,
because sometimes there's only one slider. Instead, I'm using the $
().slider('value', "low/high"). I compare the two values and if
they're less than 10, I use $().slider('moveTo', ui.value - 10, "low")
or $().slider('moveTo', ui.value + 10, "high') to move the other
slider. However, as soon as the other slider moves, it calls the same
method to move its respective other slider. So they just end up
bouncing back and forth as opposed to pushing one another higher or
lower.
Any assistance would be greatly appreciated.