Skip to content

Instantly share code, notes, and snippets.

@SFantasy
Created December 23, 2014 07:26
Show Gist options
  • Save SFantasy/164f73efd81c4b3a7b88 to your computer and use it in GitHub Desktop.
Save SFantasy/164f73efd81c4b3a7b88 to your computer and use it in GitHub Desktop.
Dynamic Viewport
var width = parseInt(window.screen.width, 10);
var scale = width / 640;
document.getElementById('viewport').setAttribute(
'content', 'target-densitydpi=device-dpi,width=640,user-scalable=no,initial-scale=' + scale);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment