get-size

WebJar for get-size

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

get-size
Last Version

Last Version

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

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.3
2.0.2
1.2.2