Closed james0r closed 1 year ago
Hi @james0r,
Thank you for your suggestion. Embla doesn't expose any pre-built previous and next buttons. It only exposes methods to build this yourself:
The embla-carousel-autoplay
plugin doesn't expose anything related to navigation buttons but rather the autoplay.stop()
method as you mentioned. I don't think it should expose scrollPrev
and scrollNext
methods too because this would cause confusion. Furthermore, devs may want to do more stuff inside their scrollPrev
and scrollNext
functions like so:
const scrollNext = () => {
emblaApi.scrollNext()
const { autoplay } = emblaApi.plugins()
if (!autoplay) return
if (autoplay.options.stopOnInteraction !== false) autoplay.stop()
// Do something more here...
}
However, with this said, the carousel generator will solve this automatically for you (just tick the prev & next buttons and autoplay checkboxes). Please note that the generator is experimental at this stage though but it should work well in most cases.
Best, David
@davidjerleke That makes sense. The generator looks like it's gonna be pretty awesome!
Feature request is related to
Is your feature request related to an issue?
Describe the solution you'd like
Describe alternatives you've considered
Example Implementation