Created
October 15, 2015 15:06
-
-
Save tomzmtl/68f1a192b15ef196a6c0 to your computer and use it in GitHub Desktop.
Get viewport dimensions, vanilla JS
This file contains 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 w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); | |
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment