$('#slider3').slider({ min: 1, max: 10, step: 0.5, value: 2, slide: function(event, ui){ setTimeout(function(){ waste(600); $('#squeezeme3').css({fontSize: ui.value + "em"}); }, 1); } });
$('#slider4').slider({ min: 1, max: 10, step: 0.5, value: 2, slide: _.throttle( function(event, ui){ waste(600); $('#squeezeme4').css({fontSize: ui.value + "em"}); }, 200) });
$('#slider5').slider({ min: 1, max: 10, step: 0.5, value: 2, slide: _.debounce( function(event, ui){ waste(600); $('#squeezeme5').css({fontSize: ui.value + "em"}); }, 100) });
$.debounce = function(delay) { var lastd = $.Deferred(); return function() { var args = arguments; lastd.reject(); var d = lastd = $.Deferred(); args = arguments; setTimeout(function() { return d.resolveWith(context, args); }, delay || 100); return d.promise(); }; };Based on https://gist.github.com/1795807 from hitode99
$('#slider6').slider({ min: 1, max: 10, step: 0.5, value: 2, slide: $.debounce(this, function(event, ui){ console.log("jqDeb: ", event, ui); waste(600); $('#squeezeme6').css({fontSize: ui.value + "em"}); }, 100) });
Use arrow keys to navigate