@roghz/isinviewport

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @roghz/isinviewport

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

1.26 kB

Total Files

3

Last publish

Collaborators

  • roghz