Skip to content

Instantly share code, notes, and snippets.

@andr3
Created April 3, 2013 14:41
Show Gist options
  • Save andr3/5301805 to your computer and use it in GitHub Desktop.
Save andr3/5301805 to your computer and use it in GitHub Desktop.
How to detect whether we're dealing with a high density screen in javascript?
if ("devicePixelRatio" in window && window.devicePixelRatio>1) {
// HD code
} else {
// SD code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment