pawelgrzybek/siema

Next() onClick on Siema itself issue

Closed this issue · 1 comments

Hey there,

I'm building a website with siema, however I have an issue with the next function.
In my design, i don't want any drag, i just want the carousel to be a next button on click.

To be concrete, here's what i would love :


    const siemas = document.querySelectorAll('.siema');

    for(const siema of siemas) 
    {
      new Siema(
      {
        selector: siema,
        loop: false,
        easing: 'ease-out',
        threshold: 100,
        duration:400,
        draggable:false
      })

    const next = document.querySelector('.siema');
    next.addEventListener('click', () => Siema.next());

    }

Meaning that for every siema on the page, onclick of one of them, the one clicked goes to the next image.

Thanks ! :)

Hi.

Do you want to have one button to slide to a next slide for multiple carousels or you want a separated button for each of the carousel?

Have a good browse of the CodePen collection that I made. I am almost sure there is an example that does exactly that.

Thanks for using Siema 👋