Kevin 08b0754135 grid programme преди 4 години
..
test 08b0754135 grid programme преди 4 години
README.md 08b0754135 grid programme преди 4 години
bower.json 08b0754135 grid programme преди 4 години
get-size.js 08b0754135 grid programme преди 4 години
package.json 08b0754135 grid programme преди 4 години
sandbox.html 08b0754135 grid programme преди 4 години

README.md

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: IE10+, Android 4.0+, iOS 5+, and modern browsers

Install

Install with npm: npm install get-size

Install with Bower: bower 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.