The Intersection Observer API allows you to configure a callback that is called whenever an element, called the target, intersects either the device viewport or a specified element; for the purpose of this API, this is called the root element or root.
- onIntersect: Callback function
- rootMargin: Margin around the root. Serves to grow or shrink each side of the root element's bounding box before computing intersections.
- threshold: at what percentage of the target's visibility the observer's callback should be executed.