Skip to content

Instantly share code, notes, and snippets.

@lucasdidthis
Created August 10, 2015 13:10
Show Gist options
  • Save lucasdidthis/5c8d0e25a7b58aef0392 to your computer and use it in GitHub Desktop.
Save lucasdidthis/5c8d0e25a7b58aef0392 to your computer and use it in GitHub Desktop.
prevent iOS from zooming on doubletap (pure JS)
var doubleTouchStartTimestamp = 0;
$(document).bind("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