collider-js

1.1.0 • Public • Published

Collider JS

Check if DOM elements positions to each other

Installation

NPM

npm install collider-js --save

YARN

yarn add collider-js

Usage

import collider from 'collider-js';

of

var collider = require('collider-js');

Methods

isCollide(Element1[String], Element2[String]);

Element1, Element2 - CSS Selectors

Returns boolean if elements touch each other.

isHigher(Element1[String], Element2[String]);

Element1, Element2 - CSS Selectors

Returns boolean if top of Element1 is higher than top of Element2.

isCloserFromBottom(Element1[String], Element2[String], px[Integer]);

Element1, Element2 - CSS Selectors

px - Trigger range

Check if Element1's top is higher to Element2's bottom to px

Licence

MIT

Package Sidebar

Install

npm i collider-js

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • garf