jquery-simple-slider icon indicating copy to clipboard operation
jquery-simple-slider copied to clipboard

Destroy the slider

Open hrishabhg opened this issue 12 years ago • 2 comments

If I have to update range , I did not find any way to do so. No destroy method is found.

Only possible solution was to save the old-slider and remove it while setting new one.

hrishabhg avatar Apr 27 '13 12:04 hrishabhg

I had same problem - i needed update settings dynamically. You don't need to destroy slider, i found following way for changing settings dynamically:

var range = (units == 'kg' ? [50, 120] : [100, 265]);
var step = (units == 'kg' ? .5 : 1);
var slider = $input.data("slider-object");

if (!slider) {
    $input.simpleSlider({
        range: range,
        step: step
    }).bind("slider:changed", function (event, data) {
            console.info(data.value);
        });
} else {
    slider.settings.range = range;
    slider.settings.step = step;
    $input.simpleSlider("setValue", $input.val());
}

darklow avatar May 25 '14 11:05 darklow

Where do you get "slider-object" ?

wolendranh avatar Mar 16 '16 15:03 wolendranh