1.1.0 • Published 6 years ago

collider-js v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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