Reputation: 1274
I'm using a JQuery slider for altering some get values of an ajax request. Whenever the the slider changes, it sends a new request with the new values. However: the slider updates it changes too fast. So when I slide it and then drop it somewhere, it sends multiple request at intervals of values I crossed during the sliding. So for example, if I move the slider from 5 to 10, it sends out a request for 6, 7, 9 and finally 10. And it then takes 4-5 seconds to finally update the content to 10.
Is there a way that I can set if, for example, the slider has been on that value for half a second, only then it will make the request? Or do you guys have other solutions?
Thanks in advance!
EDIT: this is the code I'm using:
$("#slider-range").slider({
range: true,
min: 0,
max: 5000,
values: [ 0, 1250 ],
slide: function( event, ui ) {
refresh();
}});
And refresh() sends the request and updates the DOM
Upvotes: 2
Views: 366