Created
November 28, 2012 21:48
-
-
Save bjankord/4164848 to your computer and use it in GitHub Desktop.
Retina/High Resolution Javascript Check
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
// retina/high resolution check | |
var retina = function(){ | |
if(window.devicePixelRatio){ | |
if(window.devicePixelRatio >= 2){ | |
return true; | |
} | |
} else if(window.matchMedia){ | |
if (window.matchMedia('(min-resolution: 192dpi)').matches){ | |
return true; | |
} | |
} else { | |
return false; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment