Skip to main content

Accessors

note

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

domSize

Type: number

Returns the container size depending on direction (width or height).

snap.domSize; // 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

track.canLoop

Type: boolean

Indicates whether looping is currently possible.

snap.track.canLoop; // true or false

track.current

Type: number

Returns the current track value.

snap.track.current; // number

track.isEnd

Type: boolean

Indicates whether the end has been reached.
Works only for non-looping carousels.

snap.track.isEnd; // true or false

track.isInterpolated

Type: boolean

Indicates whether the track values are currently interpolated.

snap.track.isInterpolated; // true or false

track.isSlideScrolling

Type: boolean

Indicates whether the active slide is larger than the container and is currently being scrolled.

snap.track.isSlideScrolling; // true or false

track.isStart

Type: boolean

Indicates whether the start has been reached.
Works only for non-looping carousels.

snap.track.isStart; // true or false

track.loopCount

Type: number

Returns the number of completed loops.
Works only in loop mode and can contain both positive and negative values.

snap.track.loopCount; // number

track.loopedCurrent

Type: number

Returns the looped current track value. Uses the .track.loopCoord() method internally.

snap.track.loopedCurrent; // number

track.max

Type: number

Returns the maximum track value.

snap.track.max; // number

track.min

Type: number

Returns the minimum track value.

snap.track.min; // number

track.offset

Type: number

Returns the track offset.
When centered mode is enabled, the offset is always greater than 0.

snap.track.offset; // number

track.progress

Type: number

Returns the track progress:

  • from 0 to 1 in non-loop mode
  • from -Infinity to Infinity in loop mode
snap.track.progress; // number

track.target

Type: number

Returns the target track value.

snap.track.target; // number

track.influence

Type: number

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.track.influence; // number