jscottsmith / react-scroll-parallax

🔮 React hooks and components to create parallax scroll effects for banners, images or any other DOM elements.
https://react-scroll-parallax.damnthat.tv/
MIT License
2.9k stars 158 forks source link

Can you do parallax and the image will remain fixed postion? #253

Closed OptimaLPro closed 4 months ago

OptimaLPro commented 4 months ago

Hey there,

I want to know if i can achieve

https://github.com/jscottsmith/react-scroll-parallax/assets/65537815/bc510fa3-75b6-46eb-80e5-d26ef14b94aa

this effect of parallax - that you are scrolling down and the image is remain "fixed" with slightly parallax effect.

website: https://www.azurim.com/

jscottsmith commented 4 months ago

@OptimaLPro

Yes you can. Because the image is fixed you need to setup parallax using a targetElement which will determine the progress.

Here's a Codesandbox that demonstrates a similar effect as the site you shared.