I have a jQuery slider with a two handles. I'm looking to lock the first in place based on the second handle.
I've tried checking the values on the slide event and then setting the first handle back to it's lock position but it basically ignores what I set it to and continues to slide.
I have gotten it to work with the stop event but its very clunky.
I'm using a JSON object generated from the serverside to populate my sliders. This is my code for the stop event:
$(clientID).slider({
range: true,
max: slider.max,
values: [slider.minVal, slider.maxVal],
change: afterSliderChanged,
stop: onSliderStop
});
function onSliderStop(event, ui) {
for (i in sliders.sliders) {
var slider = sliders.sliders[i];
var clientID = slider.cellType + "_" + slider.objectID + "_null";
if (this.id == clientID) {
if (ui.values[0].toString() == slider.max.toString()) {
var values = $(this).slider('option', 'values');
$(this).slider('option', 'values', [parseInt(slider.max - 1), parseInt(values[1])]);
}
}
}
Anyone have any ideas?
Let me know if I need to elaborate.
Thanks! Daniel Brewer