element-client-rect
v1.0.4
Published
Returns the size of an element and its absolute position of the document.
Downloads
142
Maintainers
Readme
element-client-rect
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+