Created
November 7, 2013 14:39
-
-
Save mikedugan/7355631 to your computer and use it in GitHub Desktop.
detects and executes function on window resize with 1 second 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
| var id; | |
| $(window).resize(function() { | |
| clearTimeout(id); | |
| id = setTimeout(function() { | |
| if($(window).innerHeight() < 700 || $(window).innerWidth < 900) { | |
| //do this if it's being resized down && params met | |
| } | |
| else { | |
| //do this if it's being resized up | |
| } | |
| }, 1000); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment