Skip to content

Instantly share code, notes, and snippets.

@branneman
Last active December 27, 2018 11:58
Show Gist options
  • Save branneman/6023874 to your computer and use it in GitHub Desktop.
Save branneman/6023874 to your computer and use it in GitHub Desktop.
JavaScript window resize event with a 100ms delay
$(function() {
var resizeEnd;
$(window).on('resize', function() {
clearTimeout(resizeEnd);
resizeEnd = setTimeout(function() {
$(window).trigger('resize-end');
}, 100);
});
});
$(window).on('resize-end', function() {
console.log('IMMA RESIZED 100 MILLI-FOCKING-SECONDS AGO');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment