Stanko / react-plx

React parallax component, powerful and lightweight
https://muffinman.io/react-plx/
MIT License
687 stars 51 forks source link

Set fixed position when element is centered? #82

Closed mosesoak closed 3 years ago

mosesoak commented 3 years ago

Hi again @Stanko, how can I determine when an element is centered in the viewport in order to set position:fixed, continue parallaxing stuff horizontally, then release it after a certain scroll amount?

Thanks!

Stanko commented 3 years ago

That is straight from the demo:

https://muffinman.io/react-plx/

https://github.com/Stanko/react-plx/blob/master/docs/docs.scss#L291-L313 https://github.com/Stanko/react-plx/blob/master/docs/sticky-text.js

mosesoak commented 3 years ago

Gotcha, thanks!