Last active
February 15, 2016 07:18
-
-
Save nsorosac/a4311e5501987bbb1d09 to your computer and use it in GitHub Desktop.
Hi-DPI devices viewport
This file contains 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
// <HiDPI_viewport_compatibility> | |
if (typeof window.devicePixelRatio != 'undefined') { | |
var scale = 1 / (window.devicePixelRatio || 1); | |
if (scale != 1) { | |
document.querySelector('meta[name="viewport"]').setAttribute('content', | |
'width=device-width, initial-scale=' + scale + ', minimum-scale=' + scale); | |
} | |
} | |
// </HiDPI_viewport_compatibility> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment