returnIndex value not correct on multiple slides
See original GitHub issueHeya! Like I already mentioned on Twitter: Love the slider and lack of compromises to make it nice and modern. Also loving the events, but I do have a question on those though.
I make a lot of use of returnIndex
, but it seems that it doesn’t return the right number in the following case:
When you have a slider with multiple items to slide, i.e. ‘slidesToScroll:4’ but an amount of slides that doesn’t fill out the entire slider, i.e. 10. In this case you’d have 3 ‘pages’, two with 4 items and one with 2 items. Unfortunately, on the last page, the ‘active’ class stays stuck on the 5th item (returnIndex = 4
) which makes little sense to me as this is out of the viewport. Also, it makes that clicking the back button slides back from slide #5 instead of #9, resulting in a weird slide back (one click vs the expected 2) If I up the amount of slides to 12 the behaviour is as expected.
Is this intended or might this be a bug?
Thanks for your time!
Issue Analytics
- State:
- Created 8 years ago
- Comments:8
Top GitHub Comments
I have a similar issue, but a simpler one.
When I use
returnIndex()
at the last slide (length - 1) with therewind
option astrue
, I get the wrong index, specifically it returns the index of the previous slide. If this is a separate bug from this issue, please let me know and I’ll make a separate issue.Same here. I’m just hacking it for now - long term it would be better to move away from
inline-block
completely - slides aren’t really blocks inside a line of characters - and just usegrid
, now most people are on an evergreen browser.