@f/element-rect

1.0.0 • Public • Published

element-rect

Build status Git tag NPM version Code style

Get the bounding rect of an element, optionally relative to a particular parent

Installation

$ npm install @f/element-rect

Usage

var elementRect = require('@f/element-rect')

API

elementRect(node, offsetParent)

  • node - The node who's rect you want to get
  • offsetParent - The parent node you want the offset relative to. Usually node.offsetParent (passing true is shorthand for this).

Returns: The rect {top, left, width, height} of node relative to offsetParent (or absolute, if unspecified).

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @f/element-rect

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • f