Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi. I'm curious if it's possible to change a page's background color as the user scrolls, like done in this example.
In this example the class is the trigger for the JavaScript, and I'm not sure how I could do that in Shopify. Add a custom liquid section and put the <div class=""> there? That would tie up a lot of value section real estate, given we only have 25 per page.
Thank you.
Hi @hostilearth ,
This is Theodore from PageFly - Shopify Page Builder App.
Yes, you can change Shopify page background color on scroll using a custom Liquid section and Javascript.
Steps:
Create a Liquid Section:
Add Javascript:
Best regards,
Theodore | 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.
I'm not sure what you're suggesting. Put the JavaScript in the custom liquid section between <style> </style>? I tried that originally, and it didn't work.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025