get-size

WebJar for get-size

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

get-size
Last Version

Last Version

2.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

get-size
WebJar for get-size
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/desandro/get-size

Download get-size

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/get-size/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>get-size</artifactId>
    <version>2.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/get-size/
implementation 'org.webjars.bower:get-size:2.0.2'
// https://jarcasting.com/artifacts/org.webjars.bower/get-size/
implementation ("org.webjars.bower:get-size:2.0.2")
'org.webjars.bower:get-size:jar:2.0.2'
<dependency org="org.webjars.bower" name="get-size" rev="2.0.2">
  <artifact name="get-size" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='get-size', version='2.0.2')
)
libraryDependencies += "org.webjars.bower" % "get-size" % "2.0.2"
[org.webjars.bower/get-size "2.0.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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.

Versions

Version
2.0.2
1.2.2