civiccc / react-waypoint

A React component to execute a function whenever you scroll to an element.
MIT License
4.08k stars 208 forks source link

Offset from an edge relative to the other edge of the container #340

Open y1n0 opened 3 years ago

y1n0 commented 3 years ago

Hello, everyone. How can we achieve something like <Waypoint bottomOffset="calc(100% - 50px)"} />

I wanna be able to combine that with topOffset={50} so that Waypoint will fire each time an element (passed to Waypoint as children) crosses that line from either direction

trotzig commented 3 years ago

For this type of fine-control behavior I would probably look into using IntersectionObserver.