Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AdeptSEO/12ebe9343c30c2f59c8f716b33172e20 to your computer and use it in GitHub Desktop.
Save AdeptSEO/12ebe9343c30c2f59c8f716b33172e20 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