Created
December 3, 2012 23:52
-
-
Save amaxwell01/4199170 to your computer and use it in GitHub Desktop.
window resize delay
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
| // Run code on resize, but give it a slight delay so that we aren't always calculating it | |
| $(window).resize( function() { | |
| if( timer ) { | |
| clearTimeout(timer); | |
| } | |
| var timer = setTimeout( function() { | |
| // On Resize Code Goes Here | |
| }, 100 ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are a life saver!