loryjs / loryjs/lory

returnIndex value not correct on multiple slides

Open
#197 8 comments 0 reactions 1 assignee Claimed by @nstanard View on GitHub
bug
Dominant language
JavaScript
Stars
2.3k
Forks
232
PR merge metrics
No merged PRs in 30d

Description

Heya! 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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.