Skip to content

Instantly share code, notes, and snippets.

@bjankord
Created November 28, 2012 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjankord/4164848 to your computer and use it in GitHub Desktop.
Save bjankord/4164848 to your computer and use it in GitHub Desktop.
Retina/High Resolution Javascript Check
// 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