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

Wallop.next() function using "showPrevious" instead of "showNext" for first slide in carousel mode #41

Closed
MissFerrety opened this issue Sep 4, 2015 · 5 comments

Comments

@MissFerrety
Copy link

This makes it difficult to activate the appropriate animations or transitions unless that is really what one is aiming for, but I would think the expected behavior would generally be to have consistent transitions. Perhaps include --first and --last classes on Wallop items, or a new option to include in the slider declaration.

@peduarte
Copy link
Owner

peduarte commented Sep 4, 2015

Hmmm I'm not sure I fully understand this one 😁

wallop just adds classes that it needs. If you need a first or last class in your items, feel free to add them.

wallop is very flexible and by listening to the change event, you can get access to the currentItemIndex property and again, to loads of stuff.

I wouldnt want to bloat wallop with too many more classes as I was to provide just the basics and give developers the freedom to extend it.

But maybe I misunderstood your question...

@MissFerrety
Copy link
Author

What I mean is that by automatically assigning the first slide of the bunch with the opposite class than the rest of the slider is moving in, you trigger the a movement that may not be what is expected, especially since carousel is on by default.

With --slide for example, as the slider progresses through each item, things come in from the right. However, once the first slide is reached again, the hide/show classes switch from hidePrevious & showNext to hideNext' & 'showPrevious. This causes a (rather jarring) change from the right-left behavior to left-right instead.

I think -- and I may be wrong her, plus it is also ultimately your decision -- that the expectation for a carousel slider is to consistently move in the same direction, and so this opposite-classing behavior may not be ideal.

@peduarte
Copy link
Owner

peduarte commented Sep 4, 2015

Ah...
Yes.

I know exactly what you mean.

I am actually working on this, and I also noticed it while testing the slide animation.
Basically, what I am doing is introducing a direction variable – where it stores whether the user is navigating forwards or backwards.

This will ensure the right classes are added based on the direction of the navigation.

Thanks for raising this and well spotted 👍

@MissFerrety
Copy link
Author

Thanks for being on top of things! I'll look forward to a new release, as the fade animation is clouding my content (#40) and slide is my next best option. I've just overwritten my JS to only use a single set of classes since I don't have the time or budget to spend reworking anything now and hope the client doesn't ask for forward/backward navigation!

@peduarte
Copy link
Owner

peduarte commented Sep 9, 2015

@MissFerrety Just to let you know I fixed the fade animation. Will close this and create a new issue with the 'direction' task.

@peduarte peduarte closed this as completed Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants