How can I detect when a slide has been changed through swiping on mobile? I have tried attaching a swipe event through jQuery to .slick-active but the event doesn't trigger.
$('.slick-active').on('swipe', () => {
console.log('swipe');
});
https://jsfiddle.net/20bumb4g/4536/
Thanks!
You can use the provided afterChange callback.
See https://jsfiddle.net/p3dn0Lwu/
Thanks for your response! I'm actually already using afterChange but for the purposes of my app, I need to determine whether a slide was changed through swiping, clicking the arrows or clicking the dots etc. Attaching a jQuery click event works fine for the arrows/dots, but for some reason the swipe event doesn't work.
We have the onSwipe event hook for that.
how to use freescrolling with react-slick?
Most helpful comment
Thanks for your response! I'm actually already using
afterChangebut for the purposes of my app, I need to determine whether a slide was changed through swiping, clicking the arrows or clicking the dots etc. Attaching a jQuery click event works fine for the arrows/dots, but for some reason the swipe event doesn't work.