This commit is contained in:
Alex Corbi 2019-09-30 10:44:43 +02:00
parent 36c5cc15a7
commit f972d8d46e
176 changed files with 62106 additions and 59068 deletions

View file

@ -1,32 +1,24 @@
# getSize
Get the size of elements. Used in [Masonry](https://masonry.desandro.com), [Isotope](https://isotope.metafizzy.co), & [Flickity](https://flickity.metafizzy.co).
Get the size of elements.
``` js
var size = getSize( elem );
// elem can be an element
var size = getSize( document.querySelector('.selector') )
// elem can be a selector string
var size = getSize('.selector')
var size = getSize( document.querySelector('#selector') )
// elem can be a string, used as a query selector
var size = getSize('#selector')
```
Returns an object with:
+ width, height
+ innerWidth, innerHeight
+ outerWidth, outerHeight
+ paddingLeft, paddingTop, paddingRight, paddingBottom
+ marginLeft, marginTop, marginRight, marginBottom
+ borderLeftWidth, borderTopWidth, borderRightWidth, borderBottomWidth
+ isBorderBox
Returns an object with: `width`, `height`, `innerWidth/Height`, `outerWidth/Height`, `paddingLeft/Top/Right/Bottom`, `marginLeft/Top/Right/Bottom`, `borderLeft/Top/Right/BottomWidth` and `isBorderBox`.
Browser support: IE10+, Android 4.0+, iOS 5+, and modern browsers
## Install
Install with npm: `npm install get-size`
Install with [Bower](http://bower.io): `bower install get-size`
Install with [Bower](https://bower.io): `bower install get-size`
Install with npm: `npm install get-size`
## Firefox hidden iframe bug
@ -42,4 +34,4 @@ Install with [Bower](https://bower.io): `bower install get-size`
## MIT License
getSize is released under the [MIT License](https://desandro.mit-license.org/).
getSize is released under the [MIT License](http://desandro.mit-license.org/).