You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to play several LottiePlayers in the same container one after the other.
It is possible to listen if the player is ready and set the first element to play().
However, listening to whether the animation is finished to start the next one doesn't work. (neither 'complete' nor 'loop')
Where is my error?
(My project is older and therefore still uses jquery ...)
let player;
let lottieArea = $('.js-lottie-area');
let lottiePlayers = lottieArea.find('.js-lottie-delay');
let current = 0;
function playNextLottie() {
if (current >= lottiePlayers.length) {
return;
}
player = lottiePlayers[current];
$(player).on('ready', function () {
create({
// mode: 'scroll',
player: player,
container: lottieArea
})
player.play();
});
$(player).on('complete', function () {
current++;
playNextLottie();
});
$(player).on('loop', function () {
current++;
playNextLottie();
});
}
playNextLottie();
The text was updated successfully, but these errors were encountered:
I would like to play several LottiePlayers in the same container one after the other.
It is possible to listen if the player is ready and set the first element to play().
However, listening to whether the animation is finished to start the next one doesn't work. (neither 'complete' nor 'loop')
Where is my error?
(My project is older and therefore still uses jquery ...)
The text was updated successfully, but these errors were encountered: