UNPKG

javascript-inviewport

Version:

A simple to use, light weight, zero dependency, pure JavaScript and TypeScript ready plugin that uses the intersection observer to determine whether an element has entered within the windows viewport.

17 lines (13 loc) 324 B
/** @format */ interface OberverConfig { root?: Element | null; rootMargin?: string; threshold?: number | number[]; } declare function inViewport( element: HTMLElement, threshold: number | number[], callback: Function | Function[], advancedConfiguration?: OberverConfig | null ): void; export = inViewport;