I am using react-slick and I am trying to find the solution to go to initial slide on clicking the last slide
I have tried adding afterChange
,beforeChange
and added slickGoto(0)
if nextslide
is equal to last-slide-num.Actually
nothing happens
I have gone through this... but that is not sufficient
const settings = {
dots: false,
infinite: false,
autoplay: false,
speed: 500,
arrows: true,
slidesToShow:2.7,
beforeChange:(current,next) => {
if(current === 2){
this.slider.slickGoTo(0);
}
},
}
This is the setting
Expected should go to initial slide