Created
December 4, 2014 13:54
-
-
Save jnsdbr/bacd42f3202a8ce31436 to your computer and use it in GitHub Desktop.
checkRetina.js
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
function displayIsRetina() | |
{ | |
return (window.devicePixelRatio || (window.matchMedia && window.matchMedia("(min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 1.5),(-moz-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5)").matches? 2 : 1) || 1) > 1 ? true : false) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment