Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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 %}
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024