Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save benald/9a65f86a3f9664236e67b1727f4b6b56 to your computer and use it in GitHub Desktop.
Save benald/9a65f86a3f9664236e67b1727f4b6b56 to your computer and use it in GitHub Desktop.
An accurate cross browser / device viewport measurement
// 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