Skip to content

[Help]: Delay between transitions per slide #743

Answered by davidjerleke
SergkeiM asked this question in Help
Discussion options

You must be logged in to vote

@SergkeiM not anything that comes to mind other than stopping autoplay on every select event and run play again manually:

emblaApi.value.on('select', (emblaApi) => {
  const { autoplay } = emblaApi.value.plugins()
  const currentIndex = emblaApi.selectedScrollSnap() // use this index to determine what delay you want for the next index
  autoplay.stop() // stop autoplay
  autoplay.start() // start this with a timer but be sure to include the current delay in your calculation
})

Cumbersome but that's the only way I can think of right now.

Best,
David

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@davidjerleke
Comment options

Answer selected by SergkeiM
@SergkeiM
Comment options

@davidjerleke
Comment options

@SergkeiM
Comment options

@sarussss
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Question about how to achieve something
3 participants