-
-
Save addisonbgross/522f1d0c8b3f630f8ce63ff78597ad99 to your computer and use it in GitHub Desktop.
Window resize event listener with an added delay. This stops the resize event from firing constantly while resizing
This file contains hidden or 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 handleResize() { | |
clearTimeout(this.delayer); | |
this.delayer = setTimeout(someNamedFunction, 200); | |
} | |
window.addEventListener('resize', handleResize); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment