Socket
Socket
Sign inDemoInstall

get-size

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    get-size

measures element size


Version published
Maintainers
1
Install size
17.5 kB
Created

Readme

Source

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.

Keywords

FAQs

Last updated on 20 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc