Skip to content

Instantly share code, notes, and snippets.

@Demwunz
Last active October 6, 2015 07:37
Show Gist options
  • Select an option

  • Save Demwunz/2959289 to your computer and use it in GitHub Desktop.

Select an option

Save Demwunz/2959289 to your computer and use it in GitHub Desktop.
jQuery Deferred Resize Event
$.fn.extend({
deferredResize : function(fn, delay){
var timer = null;
$(this).resize(function(){
if(timer != null){
clearTimeout(timer);
timer = null;
}
timer = setTimeout(fn, delay);
});
return this;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment