element-scroll-position
v0.0.2
Published
This is a simple library to get the scroll position of an element
Downloads
3
Readme
Element Scroll Position
This is a simple script that allows you to save and restore the scroll position of an element.
Usage
import { scrollPosition } from 'element-scroll-position';
const element = document.querySelector('.element');
const scroll = scrollPosition(element);
// And then we get this object
{
isTop: boolean;
isBetween: boolean
isBottom: boolean;
}