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

slickPrev and slickNext, only one is working #3556

Open
pppws opened this issue Sep 5, 2018 · 1 comment
Open

slickPrev and slickNext, only one is working #3556

pppws opened this issue Sep 5, 2018 · 1 comment

Comments

@pppws
Copy link

pppws commented Sep 5, 2018

when using $slider.slick("slickPrev"); and $slider.slick("slickNext"); only one is working.

====================================================================

[ paste your jsfiddle link here ]

http://jsfiddle.net/fmo50w7n/5150/

====================================================================

What is the expected behaviour?

when clicking on the left side of the screen i want to show the previous slide, when clicking on the right side i want to show the next slide.

====================================================================

What is observed behaviour?

only the first if-statement in the .js file is fulfilled. while the console outputs the right side (left = prev, right = next) the slideshow only processes the first statement, in this case always the previous slide.

====================================================================

@danielpost
Copy link

This happens because you add the event listeners (for example when the mouse is on the left), but don't unregister them when the mouse moves to the right.

A better way would be this: http://jsfiddle.net/jc7fn34a/

For what it's worth, questions like this are better suited for StackOverflow, as they're not really an issue with the library.

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

2 participants