Created
January 29, 2014 09:08
-
-
Save nicklasos/8684248 to your computer and use it in GitHub Desktop.
iPad, iPod and iPhone initial scale
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
(function(doc) { | |
var viewport = document.getElementById('viewport'); | |
if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) { | |
doc.getElementById("viewport").setAttribute("content", "width=1024,initial-scale=0.469"); | |
} else if ( navigator.userAgent.match(/iPad/i) ) { | |
doc.getElementById("viewport").setAttribute("content", "initial-scale=1.0"); | |
} | |
}(document)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment