bloody-offset
v0.0.0
Published
gets an element's offset
Downloads
7,615
Readme
offset
install
$ npm install bloody-offset
require
var offset = require("bloody-offset")
api
offset(element) > object
returns element's offset
object.height
: integer, element's heightobject.width
: integer, element's widthobject.top
: integer, element's top offsetobject.left
: integer, element's left offset
example
var elementOffset = offset(element)
lightbox.style.top = elementOffset.top + "px"
lightbox.style.left = elementOffset.left + "px"
lightbox.style.display = "block"