Created
May 9, 2011 15:07
-
-
Save vincicat/962698 to your computer and use it in GitHub Desktop.
[iOS][Safari] Avoid :focus zooming #2
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
var $viewportMeta = $('meta[name="viewport"]'); | |
$('input, select, textarea').bind('focus blur', function(event) { | |
$viewportMeta.attr('content', 'width=device-width,initial-scale=1,maximum-scale=' + (event.type == 'blur' ? 10 : 1)); | |
}); | |
//The browser starts zooming in but immediately zooms out again when the elements gets focus. I like that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment