1.0.0 • Published 2 years ago

@roghz/isinviewport v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

isInViewport()

Small script to check element is on the viewport.

USAGE

Install package by npm

npm i @roghz/isinviewport

Install package by yarn

yarn add @roghz/isinviewport

Usage Example

import { isInViewport } from '@roghz/isinviewport';

const section = document.querySelectorAll('section');
section.forEach(item => {
    if (isInViewport(item)) {
        console.log(item);
    }
});

LICENSE

MIT License

1.0.0

2 years ago