All things Shopify and commerce
Hello,
I'm trying to make my product images sticky in Empire v10. I had the following code in my theme.css file
@media(min-width: 750px){
.template-product .site-main {
overflow: visible;
}
.template-product .product-gallery.click-to-zoom-enabled {
position: -webkit-sticky;
position: sticky;
top: 0;
display: block;
align-self: flex-start;
}
}
however after updating the theme this has stopped working.
Site is www.indigohomeandgift.co.uk
Thanks in advance.
Solved! Go to the solution
This is an accepted solution.
I've fixed it. There must have been some conflicting code in the file somewhere as I put
#site-main .product-gallery.click-to-zoom-enabled {
height: fit-content;
position: sticky;
top: 177px;
/* Ensure the sticky element appears above other content */
}
higher up in the theme.css file and this fixed it.
Hi @matthewalker ,
You can try this code by following these steps:
Step 1: Go to Online Store->Theme->Edit code.
Step 2: Search file theme.liquid
Step 3: Paste the below code at the bottom of the file -> Save
<style>
#site-main .product-gallery.click-to-zoom-enabled{
height: max-content;
position: sticky;
top: 0px;
}
</style>
Hope my solution works perfectly for you!
Best regards,
Oliver | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Hello Oliver,
Thank you for your help.
Unfortunately, this didn't work.
Any other suggestions?
Thanks
This is an accepted solution.
I've fixed it. There must have been some conflicting code in the file somewhere as I put
#site-main .product-gallery.click-to-zoom-enabled {
height: fit-content;
position: sticky;
top: 177px;
/* Ensure the sticky element appears above other content */
}
higher up in the theme.css file and this fixed it.
Brilliant. Worked a treat.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024