Closed FYITom closed 4 years ago
I'm not sure if that's possible because basicScroll allows you to start and stop animating elements that aren't in the viewport (or become visible during the animation). It's not planned from my side, but it would be cool to see a proof of concept.
Intersection Observer API exists to detect elements that displayed/going to be displayed or not... you can set the threshold of the visibility... check this impl: https://github.com/wes337/io-animate/blob/master/src/index.js
Rather than using getBoundingClientRect() move to the much more performant Intersection Observer API. It will also make calculations easier too.