getClientSize
Commons
stable
Returns clientWidth or clientHeight of an element depending on the orientation axis. Used by SlideGroup to measure scrollable container dimensions.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- isHorizontalrequiredboolean
- When true, returns element.clientWidth; when false, returns element.clientHeight.
- elementHTMLElement
- The DOM element to measure. Returns 0 when omitted or falsy.
API
Return value
The value returned by this util.
- The client dimension in pixels (width or height depending on isHorizontal), or 0 when no element is provided.
Usage
Examples
Ready-to-paste usage snippets.
Measure a scrollable container