All things Shopify and commerce
How can we Defer offscreen images in Shopify when images are coming from Shopify cdn?
Hi @maroofimran Welcome to the Shopify Community,
If the cdn is used by your theme or store then you can set a class of "Lazy" or "Lazyload" for the image tag example below
<img class="lazyload" src="yourimage.png" />
in this way you can defer off screen images.
Thanks
in which .liquid file I should place this lazyload?
can you please confirm which theme you are using. its depends on the theme structure if the issue is on collection page the file will be different if the issue on the product page also the issue has been different so can you please explain on which page you are trying defer image ?
Thanks
I am trying to defer images on my main home page or also on product pages and I am using focal theme.
Hi @maroofimran
find media.liquid, or product-media.liquid and find <img> tag and add class of "lazyload" in that and hit save and test it. also please let me know if i can help you on this.
Thanks
not working same error I tried loading="lazy" also class="lazyload"
Can you please confirm if i can do it for you?
Thanks
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024