Skip to content

Instantly share code, notes, and snippets.

@simple17
Created April 15, 2020 11:14
Show Gist options
  • Save simple17/c86fc1bfded7d4695538e16452cfb9a3 to your computer and use it in GitHub Desktop.
Save simple17/c86fc1bfded7d4695538e16452cfb9a3 to your computer and use it in GitHub Desktop.
[Detect Viewport]
const vw = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
const vh = 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