css3 - Load various set of retina graphics based on screen size -
my setup have few versions of site. on larger screens there slide show , on phones , other smaller screens there scroll-through site. these 2 versions of site load different graphics.
i've been puzzling on how conditionally load retina graphics. need load first set of retina graphics retina devices have screens big enough slide show, if you're on phone, first set should not loaded, , second set of retina graphics should overwrite second set of images used scroll-through site.
i'm using trigger , replace normal graphics retina:
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { that's @ beginning of media queries , replaces images desktop site. have few sections devoted adjusting layout:
@media , (min-width: 1024px) , (max-width: 1099px){ @media , (min-width: 768px) , (max-width: 1023px) { @media , (max-width: 767px) { // query small phone sized layout. @media , (max-width: 767px) , ((-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)) { that last query attempt swap retina images phone site. not working , no arrangement i've tried has worked.
ideas?
thanks
i suggest using jquery plugin e.g. retina.js or response.js if offer different images based on screen resolution too.
this way have upload images in standard resolution , retina displays @2x before file extension. (retina.js, response.js lot more powerful requires more work on side)
also think need address iphone 4 different media query.
-webkit-min-device-pixel-ratio: 1,5 should trick.
Comments
Post a Comment