Skip to content

Instantly share code, notes, and snippets.

@EvanLovely
Created August 13, 2012 23:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EvanLovely/3344678 to your computer and use it in GitHub Desktop.
Save EvanLovely/3344678 to your computer and use it in GitHub Desktop.
reset scaling on iPhones on orientation change
// reset scaling on iPhones on orientation change. author: @axolx
if (navigator.userAgent.match(/iPhone/i)) {
$(window).bind('orientationchange', function(event) {
$('meta[name="viewport"]').attr('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0');
$(window).resize();
}).trigger('orientationchange');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment