getOffsetPosition
Commons
stable
Returns the offsetLeft or offsetTop pixel value of a SlideGroup element depending on the axis direction. Returns 0 when the element is undefined.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- isHorizontalrequiredboolean
- When true, reads offsetLeft (horizontal axis); when false, reads offsetTop (vertical axis).
- elementHTMLElement
- The target element. When omitted, the function returns 0.
API
Return value
The value returned by this util.
- The offsetLeft or offsetTop value in pixels, or 0 if the element is absent.
Usage
Examples
Ready-to-paste usage snippets.
Read slide position in a horizontal track