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
267 23 36

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. 

- Enhanced your Cart Drawer for free, Shipping Protection included -VTN Cart Drawer Pro
- Feel free to Contact for more help (Free Support): prakash.prabhakar@vtnetzwelt.com

View solution in original post

Made4uo-Ribe
Shopify Partner
10092 2398 3030

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 are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.

View solution in original post

topnewyork
Astronaut
1301 160 218

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
Boost Your Store Sales with Volume/Tier Discount Try Big Bulk Discount
Create New Shopify Store For Just 1$/Month

View solution in original post

Replies 4 (4)

prakashVt
Shopify Partner
267 23 36

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. 

- Enhanced your Cart Drawer for free, Shipping Protection included -VTN Cart Drawer Pro
- Feel free to Contact for more help (Free Support): prakash.prabhakar@vtnetzwelt.com

gr_trading
Shopify Partner
2045 149 206

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: support@grtrading.in for quick consultation. | Shopify Free codes
To support Buy Me a Coffee

Made4uo-Ribe
Shopify Partner
10092 2398 3030

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 are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.

topnewyork
Astronaut
1301 160 218

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
Boost Your Store Sales with Volume/Tier Discount Try Big Bulk Discount
Create New Shopify Store For Just 1$/Month