Methods

General methods

Method: create({actions: array, container: string, mode: string, player: string | object, ...options})

Purpose: Creates and returns the instance of the configured LottieInteractivity object.

Parameters:

NameTypeDescription

actions

object

Contains an array of objects defining the interactivity configuration.

container

string

Used for scrolling interactions relative to the defined container.

mode

string

Defines the interactivity mode either 'cursor', 'scroll' or 'chain'.

player

string or AnimationItem or HTMLElement

Defines the Lottie to attach interactivity to. Can either be the id of a lottie-player element, the lottie-player element itself or the lottie animation object.

Return Type: LottieInteractivity

----------------------------------------------------------

Method: redefineOptions({actions: array, container: string, mode: string, player: string | object, ...options})

Purpose: Reconfigures the interactivity applied to a lottie.

Parameters:

NameTypeDescription

actions

object

Contains an array of objects defining the interactivity configuration.

container

string

Used for scrolling interactions relative to the defined container.

mode

string

Defines the interactivity mode either 'cursor', 'scroll' or 'chain'.

player

string or AnimationItem or HTMLElement

Defines the Lottie to attach interactivity to. Can either be the id of a lottie-player element, the lottie-player element itself or the lottie animation object.

Return Type: void

----------------------------------------------------------

Method: stop()

Purpose: Stop interactivity on the animation.

Return Type: void

----------------------------------------------------------

Chaining mode methods

Method: jumpToInteraction(index: number)

Purpose: Go to the action defined at the passed index.

Parameters:

NameTypeDescription

index

number

Return Type: void

----------------------------------------------------------

Method: nextInteraction(incrementIndex: boolean = true)

Purpose: Go to the next interaction manually.

Parameters:

NameTypeDescription

incrementIndex

boolean

Increment the index containing the current position in the action array.

Return Type: void

Last updated