collider-js
v1.1.0
Published
Checking for DOM elements collision
Maintainers
Readme
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
