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

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

isHorizontal
requis
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

Valeur de retour

La valeur retournée par cet util.

The client dimension in pixels (width or height depending on isHorizontal), or 0 when no element is provided.

Usage

Exemples

Extraits de code prêts à coller.

Measure a scrollable container

typescript