JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 403627
  • Score
    100M100P100Q160971F
  • License MIT

measures element size

Package Exports

  • get-size

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-size) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

getSize

Get the size of elements.

var size = getSize( elem );
// elem can be an element
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/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 Bower: bower install get-size

Install with npm: npm install get-size

Firefox hidden iframe bug

Firefox has an old bug that occurs within iframes that are hidden with display: none. To resolve this, you can use alternate CSS to hide the iframe off-screen, with out display: none.

.hide-iframe {
  visibility: hidden;
  position: absolute;
  left: -999em;
}

MIT License

getSize is released under the MIT License.