Created
January 12, 2012 20:09
-
-
Save benjamincharity/1602807 to your computer and use it in GitHub Desktop.
This locks the viewport zoom until the user touches to zoom.
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
// lock the zoom unless the user is manually zooming | |
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