I am using React-Slick to display a carousel of 4 images. The settings I have are:
{
dots: true,
infinite: true,
autoplay,
speed: 1000,
autoplaySpeed: 5500,
slidesToShow: 1,
slidesToScroll: 1,
easing: 'cubic'
}
I would like to use the slickGoTo
method in order to transition to any desired slide. Everything seems to be working fine except when, for example, I am on slide number 1 and click the button to go to slide number 4. In doing so, the sliding animation traverses slides 2 and 3. I would like to disable this animation so that the carousel slides from 1 to 4 without seeing the slides in between.
I noticed that the desired effect can be seen in the React Bootstrap carousel: https://react-bootstrap.github.io/components/carousel/
If you are on slide 1 and click the third dot to go to Slide 3, you do not traverse through slide 2. It slides right to slide 3.
I would really appreciate some suggestions as to how I can update react-slick to mimic this effect.
It's already described in the
react-slick
GitHub documentHere's how to do it