Skip to content

Instantly share code, notes, and snippets.

@quietcricket
Created July 10, 2013 06:09
Show Gist options
  • Save quietcricket/5963811 to your computer and use it in GitHub Desktop.
Save quietcricket/5963811 to your computer and use it in GitHub Desktop.
Different viewport for iPhone and iPad
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