Skip to content

Instantly share code, notes, and snippets.

@abachuk
Created July 31, 2012 15:04
Show Gist options
  • Save abachuk/3217664 to your computer and use it in GitHub Desktop.
Save abachuk/3217664 to your computer and use it in GitHub Desktop.
jQuery Mobile hacks and fixes
/********** iOS rotation zoom fix **********/
var viewport = $('meta[name="viewport"]');
var nua = navigator.userAgent;
if ((nua.match(/iPad/i)) || (nua.match(/iPhone/i)) || (nua.match(/iPod/i))) {
viewport.attr('content', 'width=device-width, minimum-scale=1.0, maximum-scale=1.0');
$('body')[0].addEventListener("gesturestart", gestureStart, false);
}
function gestureStart() {
viewport.attr('content', 'width=device-width, minimum-scale=0.25, maximum-scale=1.6');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment