Permalink
Browse files

add support for browsers that do not support devicePixelRatio but sup…

…port media queries in javascript
  • Loading branch information...
1 parent cf6981a commit ffb6b38b52a1138b66a79edc6df4623d62d24e95 @michelv michelv committed Aug 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/retina.js
View
@@ -104,7 +104,7 @@ RetinaImage.prototype.swap = function(path) {
// Bind everything to the window object's onload.
// This helps wait for the images to get loaded into the DOM.
-if (root.devicePixelRatio > 1) {
+if (root.devicePixelRatio > 1 || window.matchMedia('(min-resolution: 1.1dppx)').matches) {
window.onload = function() {
var images = document.getElementsByTagName("img"), retinaImages = [], i, image;
for (i = 0; i < images.length; i++) {

0 comments on commit ffb6b38

Please sign in to comment.