Created
September 20, 2019 01:27
-
-
Save benald/9a65f86a3f9664236e67b1727f4b6b56 to your computer and use it in GitHub Desktop.
An accurate cross browser / device viewport measurement
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
// Set cross-browser viewport height and width variable | |
viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); | |
viewWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment