Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong behaviour for slider with two slides #79

Open
honzabilek4 opened this issue Mar 6, 2017 · 0 comments
Open

Wrong behaviour for slider with two slides #79

honzabilek4 opened this issue Mar 6, 2017 · 0 comments

Comments

@honzabilek4
Copy link

honzabilek4 commented Mar 6, 2017

Hi,

While having slider with only two slides and carousel on, you can notice that the isForward variable is always wrong on the second slide. This causes the silder to animate the other direction than expected.

It's the same issue as mentioned in #43, wich was solved only partially.

This happens due to the ambiguity of the next / previous slides. It's the same index (0) in fact and therefore it is impossible to decide the direction here:

var isForwards = (index > this.currentItemIndex || index === 0 && this.currentItemIndex === this.lastItemIndex) && !(index === this.lastItemIndex && this.currentItemIndex === 0);
or here

One option is to determine the direction right in the next() and previous() functions and then use it in goTo().

Anyone has a better idea?

@honzabilek4 honzabilek4 changed the title Wrong behaviour for slider with 2 slides Wrong behaviour for slider with two slides Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant