1.0.4 • Published 8 years ago

element-client-rect v1.0.4

Weekly downloads
85
License
MIT
Repository
github
Last release
8 years ago

element-client-rect

Build Status JavaScript Style Guide NPM version NPM download Dependency Status DevDependency Status

Returns the size of an element and its absolute position of the document.

Install

$ npm install element-client-rect

API

getElementClientRect(el)

var getElementClientRect = require('element-client-rect')
var dom = document.body

var rect = getElementClientRect(dom)
// => {left: number, top: number, right: number, bottom: number, width: number, height: number}

Tested

  • IE 6+
  • Chrome latest
  • Safari latest
  • Firefox latest
  • iOS 8.1+
  • Android 4.0+

License

MIT