Created
August 10, 2015 13:11
-
-
Save lucasdidthis/8a2ecf406634e9ad9ca1 to your computer and use it in GitHub Desktop.
prevent iOS from zooming on doubletap (jQuery)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var doubleTouchStartTimestamp = 0; | |
document.addEventListener("touchstart", function(event){ | |
var now = +(new Date()); | |
if (doubleTouchStartTimestamp + 500 > now){ | |
event.preventDefault(); | |
}; | |
doubleTouchStartTimestamp = now; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment