Created
July 10, 2013 06:09
-
-
Save quietcricket/5963811 to your computer and use it in GitHub Desktop.
Different viewport for iPhone and iPad
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 width = screen.width; | |
if (width >= 900) { | |
$('meta[name=viewport]').attr('content','width=device-width, initial-scale=1'); | |
} else if (width < 900 && width >= 700) { // iPad in portrait mode | |
$('meta[name=viewport]').attr('content','width=device-width, initial-scale=0.8'); | |
} else if (width <700) { // anything smaller than 700px in width | |
$('meta[name=viewport]').attr('content','width=device-width, initial-scale=0.4'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment