Execute function after the user finishes using the slider

200 Views Asked by At

I want to execute some function after the user has finished using the slider and not while the slider is being manipulated.

Only after the handle stops, then start the function. I remember doing this using setTimeout and clearTimer but I don't remember how to do it exactly.

$('#slider').on('slide', function(){ 
   some_function();
});

Note that I am using nouislider and not jquery.

2

There are 2 best solutions below

0
On BEST ANSWER

Looks to me like you want a callback on the set event, which occurs when the user stops sliding.

$('#slider').on('set', function(){ 
   some_function();
});

http://refreshless.com/nouislider/events-callbacks/

0
On

Try listening for 'change' event.