Kalint Posted July 29, 2013 Share Posted July 29, 2013 Is there a way to say, if desktop show this image but if mobile hide this image? Link to comment Share on other sites More sharing options...
0 threetonesun Posted July 29, 2013 Share Posted July 29, 2013 Is there a way to say, if desktop show this image but if mobile hide this image? Sure, give every image you want to hide the same class, use a media query to hide it when the screen resolution drops below a certain point. LaP 1 Share Link to comment Share on other sites More sharing options...
0 ILikeTobacco Posted July 29, 2013 Share Posted July 29, 2013 Is there a way to say, if desktop show this image but if mobile hide this image? Yes, use CSS stylesheets. You can display a different stylesheet based on the platform http://detectmobilebrowsers.com/ Don't know if those work but its the basic idea. Have two stylesheets. Show one with images if its desktop browser and another if mobile Link to comment Share on other sites More sharing options...
0 Dick Montage Posted July 29, 2013 Share Posted July 29, 2013 Screen resolution? Use CSS and target towards mobiles. Much more elegant! Link to comment Share on other sites More sharing options...
0 threetonesun Posted July 29, 2013 Share Posted July 29, 2013 Screen resolution? Use CSS and target towards mobiles. Much more elegant! Eh? Based on what. Media queries are CSS. You can get more specific with orientation and device ratio, if you want, but in the end resolution will get you where you need to be. For reference, here's a very detailed guide to targeting every Apple i-device with media queries: http://www.stephentgilbert.com/mediaqueries/ Goes slightly overboard, depending on the situation. For a very simple optimization, you might just want a killswitch on some images when the screen size is < 1024px. Link to comment Share on other sites More sharing options...
0 Dick Montage Posted July 29, 2013 Share Posted July 29, 2013 Sorry pal, am half asleep, I read "query" as "jQuery" threetonesun 1 Share Link to comment Share on other sites More sharing options...
0 ILikeTobacco Posted July 30, 2013 Share Posted July 30, 2013 I suppose the next question is, what is the reasoning. If the purpose is to save bandwidth for mobile devices, the resolution of newer devices would now result in wasting bandwidth. Link to comment Share on other sites More sharing options...
Question
Kalint
Is there a way to say, if desktop show this image but if mobile hide this image?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts