Skip to content

Instantly share code, notes, and snippets.

@jafstar
Created July 10, 2013 18:36
Show Gist options
  • Save jafstar/5968896 to your computer and use it in GitHub Desktop.
Save jafstar/5968896 to your computer and use it in GitHub Desktop.
/*
$(document).ready(function(){
if($(window).width() < 500){
$('head').append('<meta name="viewport" content="width=device-width, initial-scale=.33, maximum-scale=1">');
} else {
$('head').append(' <meta name="viewport" content="width=device-width, initial-scale=.66, maximum-scale=1">');
}
});*/
//VARS
var small = 'width=device-width, initial-scale=.33, maximum-scale=1';
var large = 'width=device-width, initial-scale=.66, maximum-scale=1';
var viewPort = document.createElement('meta');
viewPort.id="viewport";
viewPort.name = "viewport";
if(window.outerWidth < 500){
viewPort.content = small;
} else {
viewPort.content = large;
}
document.getElementsByTagName('HEAD')[0].appendChild(viewPort);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment