Skip to content

Instantly share code, notes, and snippets.

@DuaelFr
Created October 8, 2013 12:55
Show Gist options
  • Save DuaelFr/6884247 to your computer and use it in GitHub Desktop.
Save DuaelFr/6884247 to your computer and use it in GitHub Desktop.
jQuery event resize with timer for performances
function myfunction() {
// Do sth on resize.
}
$(function() {
var intervalId;
$(window).resize(function(e) {
clearTimeout(intervalId);
intervalId = setTimeout(myfunction, 200);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment