Skip to content

Instantly share code, notes, and snippets.

@janantala
Created November 21, 2012 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janantala/4124271 to your computer and use it in GitHub Desktop.
Save janantala/4124271 to your computer and use it in GitHub Desktop.
iOS scaling fix, iOS version < 6
<meta name="viewport" content="width=device-width initial-scale=1.0">
<script>
// iOS scaling fix
// By @mathias, @cheeaun and @jdalton
(function(e){var c="addEventListener",b="gesturestart",g="querySelectorAll",f=[1,1],d=g in e?e[g]("meta[name=viewport]"):[];function a(){d.content="width=device-width,minimum-scale="+f[0]+",maximum-scale="+f[1];e.removeEventListener(b,a,true)}if((d=d[d.length-1])&&c in e){a();f=[0.25,1.6];e[c](b,a,true)}}(document));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment