How can I add parallax to the banner image on my homepage?

https://empiricalwater.com/

Just want to add parallax to the top image of the coffee. Thanks

Hi @empiricalarby

Could you explain a little more about your request?

1 Like

Yes, I want the elements above and below the banner image to move over the banner image slightly as the user scrolls down the page.

Do you mean header sticky when scroll?

No, I mean like this: https://www.youtube.com/watch?v=GFJarqbMGnQ

Except I’m hoping I don’t need to rebuild my entire homepage as pagefly cannot modify existing pages.

Add this code to Custom CSS of your banner section

.banner__media {
background-image: url('https://empiricalwater.com/cdn/shop/files/New_b9891b18-5626-46fa-833a-46437fa9fbe1.jpg?v=1700516265&width=1500');
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
min-height: 500px;
}
1 Like

Thanks for the attempt - just one issue:

It says the link is invalid.

So please add code to your theme.liquid file before tag


1 Like

Unfortunately I’m not seeing any change as a result of applying that. Please check my screenshot to make sure I did it right:

Please update the code.


1 Like

This worked on desktop! Thank you. But can you also make it work on mobile? Currently it looks very zoomed in, without any movement.

Here is a video of what it looks like on mobile:

On desktop it works great but on mobile

  • Parallax effect not working
  • Needs to be zoomed all the way out

Thank you