Overview

The Layout component arranges carousel elements by setting width, height, margin and padding according to the latest options.

Methods

listSize()

listSize(): number

Returns the list width for the horizontal carousel, or the height for the vertical carousel.

Return

The size of the list element in pixel.


slideSize()

slideSize( index: number, withoutGap?: boolean ): number

Returns the slide width for the horizontal carousel, or the height for the vertical carousel.

Params

index

Optional. A slide index.

withoutGap

Optional. Determines whether to exclude the gap amount or not.

Return

The size of the slide element in pixel.


sliderSize()

sliderSize(): number

Returns the carousel size without clones before the first slide.

Return

The width or height of the carousel without clones.


totalSize()

totalSize( index?: number, withoutGap?: boolean ): number

Returns the total width or height of slides from the head of the carousel to the specified index. This includes sizes of clones before the first slide.

Params

index

Optional. A slide index. If omitted, uses the last index.

withoutGap

Optional. Determines whether to exclude the last gap or not.

Return

The total width of slides in the horizontal carousel, or the height in the vertical one.


getPadding()

getPadding( right: boolean ): number

Returns the padding value.

Params

right

Determines whether to get paddingRight/Bottom or paddingLeft/Top.

Return

The padding value in pixel.


isOverflow()

getPadding( right: boolean ): number

Checks if the total width of slides is wider than the list element (^4.1.0). This method always returns true for fade carousels.

Return

true if the total width of slides is wider than the list element, or otherwise false.