Created
August 16, 2013 17:20
-
-
Save eltiare/6251755 to your computer and use it in GitHub Desktop.
Shameless stolen from here: http://stackoverflow.com/questions/15687276/pixels-in-css-vs-pixel-density This is used to account for various DPI differences in mobile devices for web pages. Put this in a script tag or a *.js file and include it in your document.
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
(function() { | |
var meta = document.createElement("meta"); | |
meta.setAttribute('name','viewport'); | |
meta.setAttribute('content', 'initial-scale=' + (1 / window.devicePixelRatio) + ',user-scalable=no'); | |
document.getElementsByTagName('head')[0].appendChild(meta); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment