Accessors
All Module accessors are available in this class.
activeIndex
Type: number
Returns the index of the currently active slide.
snap.activeIndex; // active slide index
activeSlide
Type: SnapSlide
Returns the currently active slide instance.
snap.activeSlide; // active slide instance
axis
Type: "x" | "y"
Returns the axis based on the current direction.
snap.axis; // "x" or "y"
container
Type: HTMLElement
Returns the carousel container element.
snap.container; // HTMLElement
containerSize
Type: number
Returns the container size depending on direction (width or height).
snap.containerSize; // number
eventsEmitter
Type: HTMLElement
Returns the element used to emit swipe and wheel events.
snap.eventsEmitter; // HTMLElement
firstSlideSize
Type: number
Returns the size of the first slide.
snap.firstSlideSize; // number
isEmpty
Type: boolean
Indicates whether there are no slides to animate.
snap.isEmpty; // true or false
isTransitioning
Type: boolean
Indicates whether a transition animation is currently in progress.
snap.isTransitioning; // true or false
scrollableSlides
Type: SnapSlide[]
Returns slides whose sizes exceed the container size.
snap.scrollableSlides; // array of slide instance
slides
Type: SnapSlide[]
Returns all slide instances.
snap.slides; // slide instances array
canLoop
Type: boolean
Indicates whether looping is currently possible.
snap.canLoop; // true or false
current
Type: number
Returns the current track value.
snap.current; // number
target
Type: number
Returns the target track value.
snap.target; // number
min
Type: number
Returns the minimum track value.
snap.min; // number
max
Type: number
Returns the maximum track value.
snap.max; // number
progress
Type: number
Returns the track progress:
- from
0to1in non-loop mode - from
-InfinitytoInfinityin loop mode
snap.progress; // number
loopedCurrent
Type: number
Returns the looped current track value. Uses the .loopCoord() method internally.
snap.loopedCurrent; // number
loopCount
Type: number
Returns the number of completed loops.
Works only in loop mode and can contain both positive and negative values.
snap.loopCount; // number
isStart
Type: boolean
Indicates whether the start has been reached.
Works only for non-looping carousels.
snap.isStart; // true or false
isEnd
Type: boolean
Indicates whether the end has been reached.
Works only for non-looping carousels.
snap.isEnd; // true or false
influence
Type: boolean
Returns the influence applied from the current value to the target, caused by swipe or wheel input.
Can be positive or negative depending on scroll direction.
snap.influence; // number
isSlideScrolling
Type: boolean
Indicates whether the active slide is larger than the container and is currently being scrolled.
snap.isSlideScrolling; // true or false