unveil
unveil copied to clipboard
Not working for retina display images on ipad Mini
I am using this library for loading @2x images for retina display devices. But it is always giving me images without retina display even in retina devices.
I came to know that problem was in window.devicePixelRatio, which is not available in ipad Mini safari.
I resolved this issue by adding a method to check for retina images.
@hemkaran - Are you able to share the code you used to fix the issue?
I have changed "retina" variable assignment to.
retina = isRetina();
function isRetina() {
var query = '(-webkit-min-device-pixel-ratio: 1.5),
(min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(min-device-pixel-ratio: 1.5),
(min-resolution: 144dpi),
(min-resolution: 1.5dppx)';
if (window.devicePixelRatio > 1 || (window.matchMedia && window.matchMedia(query).matches)) {
return true;
}
return false;
}
@hemkaran - nice thanks!