getOffsetSize
Commons
stable
Returns the offsetWidth or offsetHeight of an element depending on the axis. Returns 0 when the element is undefined. Used by SlideGroup to compute slide dimensions.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- isHorizontalrequiredboolean
- When true, reads offsetWidth; when false, reads offsetHeight.
- elementHTMLElement
- The target element. Returns 0 when omitted.
API
Return value
The value returned by this util.
- The offsetWidth or offsetHeight value in pixels, or 0 if the element is absent.
Usage
Examples
Ready-to-paste usage snippets.
Read slide width or height