1. jascanio
  2. Sherlock Holmes
  3. Commercial Templates
  4. Monday, 07 May 2018
  5.  Subscribe via email
Hi,
I'm trying to display different images when mi web is accessed from a mobile device.
These images are in an article. One image for desktop and a different image for mobile devices.
Thas anyone has any idea on how to achieve this?
Thank in advance for your help.
Regards,
Juan
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Juan

You can use the following HTML to display 2 images. One of which is hidden on desktop using the 'hidden-desktop' class. The other is hidden on phone and table using the 'hidden-phone' and 'hidden-tablet' classes...

Edit to taste replacing the # with the URL to your image

<img src="#" alt="mobile-image" class="hidden-desktop">
<img src="#" alt="desktop-image" class="hidden-phone hidden-tablet">


Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Ciarán,
Thanks for your reply!
Are hidden-desktop, hidden-phone and hidden-tablet template built-in classes, or should I declare them?

Thanks again,
Juan
  1. more than a month ago
  2. Commercial Templates
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Juan

Which template are you working with? Would you have a URL to an example of the article?

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Ciarán,
I'm using Magnolia.
You can visit the article here

Regards,
Juan
  1. more than a month ago
  2. Commercial Templates
  3. # 4
Accepted Answer Pending Moderation
0
Votes
Undo
Thank you Juan

These classes are already declared in your template CSS so simply adding the classes to your HTML should be enough.

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 5
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Ciarán,
Thanks for your reply.
Regards,
Juan
  1. more than a month ago
  2. Commercial Templates
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!