Hello everyone,
I want to make the product image sticky on mobile in the Dawn theme. I tried multiple codes and CSS, but nothing worked.
Can someone help?
Thank you in advance!
A user seeks to make product images sticky on mobile devices in Shopify’s Dawn theme (version 15.0.0). Initial attempts using various CSS solutions found in community forums failed to work.
Attempted Solutions:
theme.liquid modifications, but couldn’t locate thumbnail-related code.product__media-wrapper with position: sticky and top: 0, which didn’t function as expectedWorking Solution:
Another user provided CSS that successfully made images sticky:
.product__media-wrapper {
position: sticky;
top: 0;
z-index: 1000;
}
Final Implementation:
z-index from 1000 to 1 to prevent the sticky image from covering the main navigation menuHello everyone,
I want to make the product image sticky on mobile in the Dawn theme. I tried multiple codes and CSS, but nothing worked.
Can someone help?
Thank you in advance!
Hello there @Ivana749 welcome to the community. I came across a thread with a reply marked as a solution here https://community.shopify.com/post/1922917 for an issue similar to yours and I want you to confirm if you’ve tried out the whole process there yet.
I tried variations of that one. First I can’t find anything related to thumbnails in the theme.liquid file.
I think some change needs to be here: assets/section-main-product.css
I used this one (doesn’t work):
.product__media-wrapper { position: sticky; top: 0; }
Please share with the community.
I’m using Dawn 15.0.0
I have a few changes in the code. I added the code for Google Tag Manager, and some changes about subscription button for newsletters. Also, added some code for title tag-not to show my store name.
Honestly, I tried everything I found here on forum.
Hi Ivana749,
Can you please try the below css? Thanks!
.product__media-wrapper {
padding-left: 0;
position: sticky;
top: 0;
z-index: 1000;
}
Thank you @Code-Crafting
This seems to work, but is there a way that just the main image stays sticky?
Hello @DaisyVo
Store URL is https://rymemories.com/
I just used z-index: 1 because with 1000 my main menu was also behind the image.
For thumbnail images below the main image, I found a solution in the app I use for personalization.
Thanks again, everyone!