Last active
December 27, 2018 11:58
-
-
Save branneman/6023874 to your computer and use it in GitHub Desktop.
JavaScript window resize event with a 100ms delay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var resizeEnd; | |
$(window).on('resize', function() { | |
clearTimeout(resizeEnd); | |
resizeEnd = setTimeout(function() { | |
$(window).trigger('resize-end'); | |
}, 100); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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