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: number

The index of the slide. This can be negative or greater than the number of slides for clones.


slideIndex

slideIndex: number

The slide index where the clone corresponds. This is -1 for normal slides.


slide

slide: HTMLElement

The slide element.


container

container: HTMLElement

The container element if available, or otherwise undefined.


isClone

isClone: boolean

Indicates whether the component contains a cloned slide or not.

Methods

style()

style( prop: string, value: string | number, useContainer?: boolean ): void

Adds 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 ): boolean

Calculates 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 true if the slide is within this number.

Return

true if the slide is within the distance from the base slide, or otherwise false.