solved Eliminate Some Images for Mobile Only

Dazed
Dazed
@dazed
11 years ago
1,022 posts
I have some images on my index page that I would not like to show to users on mobile. It is just too much. Is there a way to set these images to display on non-mobile browsers?

Thanks
updated by @dazed: 04/08/14 12:24:17AM
douglas
@douglas
11 years ago
2,797 posts
You can try wrapping the images with this if statement...

{ if !jrCore_is_mobile_device() || !jrCore_is_tablet_device() }
 < img src="etc... >
{ /if }

Hope this helps,
Douglas


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 02/24/14 10:17:40AM
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Thanks Douglas. The images are still appearing after killing cache on my mobile. Thoughts?
douglas
@douglas
11 years ago
2,797 posts
Okay, try this:

{ if jrCore_is_mobile_device() || jrCore_is_tablet_device() }
{ else }
 < img src="etc... >
{ /if }

And if you are copying and pasting from this post, make sure to remove the extra spaces I've added so the code doesn't get stripped.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
brian
@brian
11 years ago
10,148 posts
This should be:

{if !jrCore_is_mobile_device() && !jrCore_is_tablet_device()}
    ... show image ....
{/if}

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 02/24/14 11:50:13AM
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Brian's suggestion definitely works. You can also use css media queries to show/hide.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Thanks all!!