We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The slides reported by the before.lory.slide event are wrong when the method slideTo( k ) is used.
before.lory.slide
slideTo( k )
This because the value nextSlide is defined by direction and by incrementing the current index;
nextSlide
direction
index
var nextSlide = direction ? index + 1 : index - 1; dispatchSliderEvent('before', 'slide', { index: index, nextSlide: nextSlide });
The following example:
var simple = lory(target, { infinite: 1, slidesToScroll: 1 }); // Listeners body.addEventListener('before.lory.slide', function(e){ console.log("before(" + e.detail.index + " => " + e.detail.nextSlide + ")"); }); body.addEventListener('after.lory.slide', function(e){ console.log("after(" + e.detail.currentSlide + ")"); }); simple.slideTo(3); simple.slideTo(1);
will return the follow output
before(1 => 0) after(4) before(4 => 3) after(2)
instead of
before(1 => 4) after(4) before(4 => 2) after(2)
The text was updated successfully, but these errors were encountered:
http://codepen.io/nstanard/pen/eBLXJJ
If you've got time go ahead and open a PR with the fix. ;]
Sorry, something went wrong.
Is there more to be done in this PR or the project is no longer being maintained?
nstanard
No branches or pull requests
The slides reported by the
before.lory.slide
event are wrong when the methodslideTo( k )
is used.This because the value
nextSlide
is defined bydirection
and by incrementing the currentindex
;The following example:
will return the follow output
instead of
The text was updated successfully, but these errors were encountered: