viewport-checker
viewport-checker copied to clipboard
Track elements with respect to the original rect
Let's say you're using this library to add an animation to an element when it scrolls into/out of view. You choose a slide animation; the element will slide in from the bottom.
The element scrolls into view. The animation starts. The first keyframe puts the element lower than where it started.
Now the element is out of view, so the classToAdd
is removed, and the callback is called. Now the element is in view.
The element flickers into eternity.