Created
August 13, 2012 23:04
-
-
Save EvanLovely/3344678 to your computer and use it in GitHub Desktop.
reset scaling on iPhones on orientation change
This file contains hidden or 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
// 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