Created
November 19, 2015 12:40
-
-
Save Teino1978-Corp/35db2bea08809032c645 to your computer and use it in GitHub Desktop.
Use JavaScript to determine the screen size correctly
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
/* | |
Drop this right after your document.ready statement and you can accurately use screenWidth and screenHeight to do dynamic calculations | |
*/ | |
screenWidth = window.innerWidth | |
|| document.documentElement.clientWidth | |
|| document.body.clientWidth; | |
screenHeight = window.innerHeight | |
|| document.documentElement.clientHeight | |
|| document.body.clientHeight; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment