pawelgrzybek / siema

Siema - Lightweight and simple carousel in pure JavaScript
https://pawelgrzybek.github.io/siema/
Other
3.49k stars 408 forks source link

currentSlide Bug #280

Open cameronkuo opened 4 years ago

cameronkuo commented 4 years ago

Hi @pawelgrzybek,

Siema is such a great plugin, but I found a problem:

When the "perPage" is greater than 1, the currentSlide will get wrong index.

Please check it.

Thanks.

galingong commented 3 years ago

I can confirm this, just ran into the bug myself.

cameronkuo commented 3 years ago

@galingong @pawelgrzybek Was this solved?

Dan-dilion commented 1 year ago

I'm not sure if this has been resolved or not (we are using an out of date version of Siema) but if you run in to this problem it seems to occasionally subtract the number of slides from the currentSlide so you can get the correct currentSlide with a simple turnery like this:

(mySiema.currentSlide < 0)
  ? (mySiema.innerElements.length + mySiema.currentSlide)
  : mySiema.currentSlide