Created
February 23, 2014 02:40
-
-
Save colelawrence/9165921 to your computer and use it in GitHub Desktop.
Javascript window resize timeout
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
// Do stuff after 100ms of no resizing | |
var resizeTimeout; | |
$(window).on("resize", function () { | |
clearTimeout(resizeTimeout); | |
resizeTimeout = setTimeout(function () { | |
// Do stuff | |
}, 100); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment