Skip to content

Instantly share code, notes, and snippets.

@ethan-deng
Last active February 25, 2017 08:03
Show Gist options
  • Select an option

  • Save ethan-deng/7214670519d3176ef674f649c776e2e4 to your computer and use it in GitHub Desktop.

Select an option

Save ethan-deng/7214670519d3176ef674f649c776e2e4 to your computer and use it in GitHub Desktop.

Prevent double tab to zoom on iOS

http://stackoverflow.com/questions/37808180/disable-viewport-zooming-ios-10-safari

function prevent(e) { e.preventDefault() }
// you could target also another nested DOM element
document.body.addEventListener('gesturechange', prevent)
document.body.addEventListener('gesturestart', prevent)
document.body.addEventListener('gestureend', prevent)

Add this to onClick event

event.preventDefault();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment