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.

typescript

API

Parameters

Input parameters accepted by this util.

isHorizontal
required
boolean
When true, returns element.clientWidth; when false, returns element.clientHeight.
element
HTMLElement
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

typescript