Add onScroll event listener to the provided container (DOM element, custom scroll, or window).
It automatically manages multiple scroll listeners by stacking them in instances.
If an instance already exists for the container, it adds the new callback to the existing stack.
Otherwise, it creates a new scroll listener.
This function supports both native scrollable elements and CustomScroll instances.
Add
onScroll
event listener to the provided container (DOM element, custom scroll, or window). It automatically manages multiple scroll listeners by stacking them in instances.If an instance already exists for the container, it adds the new callback to the existing stack. Otherwise, it creates a new scroll listener.
This function supports both native scrollable elements and
CustomScroll
instances.