Last active
December 25, 2015 20:18
-
-
Save simplesessions/7033448 to your computer and use it in GitHub Desktop.
Performant way of checking document size?
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
windowResizeHandler = null; | |
$(window).resize(function() { | |
clearTimeout(windowResizeHandler); | |
windowResizeHandler = setTimeout(function() { | |
var docWidth = $('document').width(); | |
if (docWidth > 200) { | |
// do some'n | |
} | |
}, 250); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment