andreruffert/rangeslider.js

Slider position doesn't automatically update when max is programmatically set to a lesser value

FlameWolf opened this issue · 4 comments

If the slider is currently at 500, and I programmatically set the max value to 400, the position won't be updated automatically.

If you call the update method mentioned in the docs everything should work like expected.

// Update all rangeslider instances for all
// e.g. $('input[type="range"]') elements.
// Usefull if you changed some attributes e.g. `min` or `max` etc.
$('input[type="range"]').rangeslider('update', true);

Thanks for letting me know if that works :)

Nope, that didn't work. I was using the example in the demo page, by the way. The one under the heading "Programmatic attribute changes".

It works for me. Maybe there is a miss understanding...
Feel free to setup a example codepen etc. for a simple demonstration of your issue.

@andreruffert It helped me! Thanks!!