Skip to content

bendrucker/position-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

position-diff Build Status Greenkeeper badge

Get the difference in position between two elements

Install

$ npm install --save position-diff

Usage

var positionDiff = require('position-diff')

positionDiff(el1, el2)
//=> {x, y}

API

positionDiff(element1, element2) -> object

element1 / element2

Required
Type: HTMLElement

HTML elements. The position of the first will be subtracted from the second and {x, y} (Number) is returned.

options
foo

Type: boolean
Default: false

Lorem ipsum.

License

MIT © Ben Drucker

About

Get the difference in position between two elements

Resources

License

Stars

Watchers

Forks

Packages

No packages published