Skip to content

Instantly share code, notes, and snippets.

@matthewbeta
Created March 24, 2015 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewbeta/4e037b4d4d911ebf83c7 to your computer and use it in GitHub Desktop.
Save matthewbeta/4e037b4d4d911ebf83c7 to your computer and use it in GitHub Desktop.
Resize event debounce from CSS tricks
var resizeTimer;
$(window).on('resize', function(e) {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
// Run code here, resizing has "stopped"
}, 250);
});
//https://css-tricks.com/snippets/jquery/done-resizing-event/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment