Different banner images to different devices

Solved

Different banner images to different devices

Wanigajameson
Tourist
14 0 3

Hey everyone,

 

One last question for today: I have two images, and I want to display them based on the device being used. For example, I want image 1 to be shown on a desktop PC and image 2 on a mobile device. How can I achieve this?

 

Thanks!

 

Accepted Solutions (3)

prakashVt
Shopify Partner
220 20 33

This is an accepted solution.

So there are many ways to do it but the simple way only using the css is below: 

First create another image tag just below the current image and give it the mobile version url 

 <img src="{{'desktop-image.jpg' | assets_url}}" alt="Desktop Image" class="responsive-image desktop-image">

    <!-- Mobile Image -->
    <img src="{{'mobile-image.jpg' | assets_url}}" alt="Mobile Image" class="responsive-image mobile-image">

Then add css as below 

 /* Image for mobile devices */
        @media only screen and (max-width: 768px) {
            .desktop-image {
                display: none;
            }
            .mobile-image {
                display: block;
            }
        }

        /* Hide mobile image on desktop */
        @media only screen and (min-width: 769px) {
            .mobile-image {
                display: none;
            }
        }

 

Please adjust the code and class name based on your need. 

 

Let me know if you need any further help. 

- Free Customer Dashboard apps that enhanced your customers' experience - VTN Customer Dashboard
- Feel free to Contact for more help (Free Support): prakash.prabhakar@vtnetzwelt.com

View solution in original post

Made4uo-Ribe
Shopify Partner
7756 1876 2297

This is an accepted solution.

Hi @Wanigajameson 

This design requires a developer, or if you're comfortable with code, you can check this out.

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free.
Need THEME UPDATES but has custom codes? No worries, contact us for affordable price.

View solution in original post

topnewyork
Globetrotter
633 113 134

This is an accepted solution.

Hi @Wanigajameson , kindly checkout the below videos

 

And

 

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel

View solution in original post

Replies 5 (5)

prakashVt
Shopify Partner
220 20 33

This is an accepted solution.

So there are many ways to do it but the simple way only using the css is below: 

First create another image tag just below the current image and give it the mobile version url 

 <img src="{{'desktop-image.jpg' | assets_url}}" alt="Desktop Image" class="responsive-image desktop-image">

    <!-- Mobile Image -->
    <img src="{{'mobile-image.jpg' | assets_url}}" alt="Mobile Image" class="responsive-image mobile-image">

Then add css as below 

 /* Image for mobile devices */
        @media only screen and (max-width: 768px) {
            .desktop-image {
                display: none;
            }
            .mobile-image {
                display: block;
            }
        }

        /* Hide mobile image on desktop */
        @media only screen and (min-width: 769px) {
            .mobile-image {
                display: none;
            }
        }

 

Please adjust the code and class name based on your need. 

 

Let me know if you need any further help. 

- Free Customer Dashboard apps that enhanced your customers' experience - VTN Customer Dashboard
- Feel free to Contact for more help (Free Support): prakash.prabhakar@vtnetzwelt.com

gr_trading
Shopify Partner
1891 145 199

Hi @Wanigajameson ,

 

You have to modify the section to provide option to upload two images and media query to show appropriate image.

 

Request you to refer the below video how you can add these settings for section.

 

Hope this will help..., don't forget to like and mark as solution.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee

Sangeetanahar
Excursionist
413 25 53

hello @Wanigajameson 

I have made the code for you, you check the video, there is different image for desktop and different for mobile, if you want this then tell me and what is your theme

check the video:https://www.awesomescreenshot.com/video/31159662?key=7a4c6182d0e9a7ddb5047fdd0ecfb6d7

thanks

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -sangeetarahuldhiman@gmail.com - Skype: live:sangeetarahuldhiman -Whatsapp: +917009811712
Checkout Some Free Sections Here

Made4uo-Ribe
Shopify Partner
7756 1876 2297

This is an accepted solution.

Hi @Wanigajameson 

This design requires a developer, or if you're comfortable with code, you can check this out.

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free.
Need THEME UPDATES but has custom codes? No worries, contact us for affordable price.

topnewyork
Globetrotter
633 113 134

This is an accepted solution.

Hi @Wanigajameson , kindly checkout the below videos

 

And

 

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel