1.0.0 • Published 10 years ago
@f/element-rect v1.0.0
element-rect
Get the bounding rect of an element, optionally relative to a particular parent
Installation
$ npm install @f/element-rectUsage
var elementRect = require('@f/element-rect')API
elementRect(node, offsetParent)
node- The node who's rect you want to getoffsetParent- The parent node you want the offset relative to. Usuallynode.offsetParent(passingtrueis shorthand for this).
Returns: The rect {top, left, width, height} of node relative to offsetParent (or absolute, if unspecified).
License
MIT
1.0.0
10 years ago