Slide
Overview
The Slide sub-component handles each slide.
Use the Slides component to interact this because the Components collection does not contain this component.
Properties
index
index: numberThe index of the slide. This can be negative or greater than the number of slides for clones.
slideIndex
slideIndex: numberThe slide index where the clone corresponds. This is -1 for normal slides.
slide
slide: HTMLElementThe slide element.
container
container: HTMLElementThe container element if available, or otherwise undefined.
isClone
isClone: booleanIndicates whether the component contains a cloned slide or not.
Methods
style()
style( prop: string, value: string | number, useContainer?: boolean ): voidAdds a CSS rule to the slide or the container.
Params
prop | A property name. |
|---|---|
value | A CSS value to add. |
useContainer | Optional. Determines whether to apply the style to the container or not. |
isWithin()
isWithin( from: number, distance: number ): booleanCalculates how far this slide is from another slide and
returns true if the distance is within the given distance.
Params
from | An index of a base slide. |
|---|---|
distance | Distance to test. The method returns |
Return
true if the slide is within the distance from the base slide, or otherwise false.