Layout
Overview
The Layout component arranges slider elements by setting width, height, margin and padding according to the latest options.
Methods
listSize()
listSize(): number
Returns the list width for the horizontal slider, or the height for the vertical slider.
Return
The size of the list element in pixel.
slideSize()
slideSize( index: number, withoutGap?: boolean ): number
Returns the slide width for the horizontal slider, or the height for the vertical slider.
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 slider size without clones before the first slide.
Return
The width or height of the slider without clones.
totalSize()
totalSize( index?: number, withoutGap?: boolean ): number
Returns the total width or height of slides from the head of the slider 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 slider, or the height in the vertical one.
getPadding()
getPadding( right: boolean ): number
Returns the padding value.
Params
right | Determines whether to get |
---|
Return
The padding value in pixel.