Reputation: 81
I am trying to detect the first slide and last slide using slick.js.https://github.com/kenwheeler/slick How can I do that?
Upvotes: 1
Views: 6330
Reputation: 1978
There is couple of events you can use to detect this:
beforeChange
$('.slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
console.log(nextSlide);
});
afterChange
$('.slider').on('afterChange', function(event, slick, currentSlide){
console.log(currentSlide);
});
swipe
$('.slider').on('swipe', function(event, slick, direction){
console.log(direction);
// left
});
Let me know if this works for u.
Thanks
Upvotes: 2