-
-
Save Lukas238/e4a6827c6f3b1c94310e to your computer and use it in GitHub Desktop.
Get real width of window. The same as CSS media query.
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
function viewport() { | |
var e = window, a = 'inner'; | |
if (!('innerWidth' in window )) { | |
a = 'client'; | |
e = document.documentElement || document.body; | |
} | |
//return { width : e[ a+'Width' ] , height : e[ a+'Height' ] }; | |
return e[ a+'Width' ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment