Created
January 11, 2013 05:25
-
-
Save bryanstedman/4508166 to your computer and use it in GitHub Desktop.
Detect retina display with javascript
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
var retina = window.devicePixelRatio > 1; | |
if (retina) { | |
// the user has a retina display | |
} | |
else { | |
// the user has a non-retina display | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I put the zoom in Chrome to 110%, the window.devicePixelRatio is 1.1
So, this detection is not sufficient.