Created
January 8, 2016 14:24
-
-
Save codescribblr/826a5734b1b3d935f48a to your computer and use it in GitHub Desktop.
best cross-browser way to get "actual" window width in js. This replaces the previously used $(window).width() that was unreliable because of the scroll bar. Requires Modernizr.
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
| if (Modernizr.mq('(max-width: 767px)')) { | |
| //... | |
| } else { | |
| //... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment