Liquid, JavaScript, themes, sales channels
Hi all, I'm hoping someone can point out what I'm doing wrong here please.
I'm trying to add a simple 'Mobile Image' option to the Image Banner section in the DAWN theme.
I have the Image Picker working etc, but media queries to hide depending on screen size just don't seem to be applying. Here's the few sections of relevant code. Any help/advice appreciated! Sorry if I'm being an idiot..
------------------------------
{
"type": "image_picker",
"id": "image",
"label": "Desktop Image"
},
{
"type": "image_picker",
"id": "image_mobile",
"label": "Mobile Image"
},
------------------------------
{{ section.settings.image | image_url: width: 3840 | image_tag:
loading: 'lazy',
width: section.settings.image.width,
height: image_height,
class: desktop_image,
sizes: sizes,
widths: widths,
alt: section.settings.image.alt | escape
}}
{{ section.settings.image_mobile | image_url: width: 3840 | image_tag:
loading: 'lazy',
width: section.settings.image_mobile.width,
height: image_height,
class: mobile_image,
sizes: sizes,
widths: widths,
alt: section.settings.image_mobile.alt | escape
}}
------------------------------
{% style %}
.desktop_image {
display: none;
}
.mobile_image {
display: block;
}
@media only screen and (min-width: 992px) {
.desktop_image {
display: block !important;
}
.mobile_image {
display: none !important;
}
}
{% endstyle %}
User | RANK |
---|---|
38 | |
24 | |
13 | |
11 | |
8 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023