vanillajs-browser-helpers
Version:
Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser
18 lines (17 loc) • 477 B
TypeScript
import type { GeneralWindow } from './shared/types';
interface ScrollInfo {
x: number;
y: number;
xMax: number;
yMax: number;
xPct: number;
yPct: number;
}
/**
* Gather the current scroll position information of a DOM element or the window
*
* @param elm - The element to find the scrolling position from
* @return The scroll information
*/
export default function scrollInfo(elm?: Element | GeneralWindow): ScrollInfo;
export {};