get-size
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/get-size package

3.0.0 • Public • Published

getSize

Get the size of elements. Used in Masonry, Isotope, & Flickity.

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')

Returns an object with:

  • width, height
  • innerWidth, innerHeight
  • outerWidth, outerHeight
  • paddingLeft, paddingTop, paddingRight, paddingBottom
  • marginLeft, marginTop, marginRight, marginBottom
  • borderLeftWidth, borderTopWidth, borderRightWidth, borderBottomWidth
  • isBorderBox

Browser support: Chrome 51+, Firefox 50+, Edge 12+, Safari 10+,

Install

npm: npm install get-size

Yarn: yarn add get-size

MIT License

getSize is released under the MIT License. Have at it.

Readme

Keywords

Package Sidebar

Install

Weekly Downloads

261,134

Version

3.0.0

License

MIT

Unpacked Size

17.1 kB

Total Files

12

Last publish

Collaborators

  • desandro