Created
August 4, 2013 22:49
-
-
Save webuniverseio/6152282 to your computer and use it in GitHub Desktop.
Fix for iPad layout scales up when rotating from portrait to landcape
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
//<meta name="viewport" content="width=device-width, initial-scale=1"> | |
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) { | |
var viewportmeta = document.querySelector('meta[name="viewport"]'); | |
if (viewportmeta) { | |
viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0'; | |
document.body.addEventListener('gesturestart', function () { | |
viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6'; | |
}, false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment