Skip to content

Instantly share code, notes, and snippets.

@tsmd
Last active February 28, 2020 03:18
Show Gist options
  • Save tsmd/81e5d9eda57b339eab7c6609109919d8 to your computer and use it in GitHub Desktop.
Save tsmd/81e5d9eda57b339eab7c6609109919d8 to your computer and use it in GitHub Desktop.
Detect pinch zooming
function isPinchZooming () {
const clientWidth = document.documentElement.clientWidth
const viewportWidth = window.visualViewport ? window.visualViewport.width : window.innerWidth
return clientWidth > viewportWidth
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment