BotDanny / react-stacked-center-carousel

A responsive, performant, well animated, swipeable, center mode carousel that stacks its slide
33 stars 12 forks source link

Is there like autoplay carousel option for slider? #9

Open dannycherry opened 1 year ago

dannycherry commented 1 year ago

I read the props and could not find it, does it exists at all autoplay functionality? If no, would be a great feature for it.

BotDanny commented 1 year ago

Hi, currently react-stacked-center-carousel indeed does not have autoplay functionality. However, you can create a function that utilizes setTimeout to call itself and ref.goNext() every few seconds. Thanks for your suggestion though! I am currently very busy with school and internship but I will definitely consider implementing auto-play once things start to slow down a bit for me.

dannycherry commented 1 year ago

@BotDanny Sure, thanks for feedback, i already created it. The package you created solved me many things, so thank you for that also. If you plan to create it, consider these things to stop/pause when user hover the carousel. Reset the counter when user changes slide either on arrows or clicking slides.

And one also request, in , would be good to have exposed info like component have props ie: dataIndex, isCenterSlide, swipeTo, slideIndex,

MatthewTt commented 6 months ago

Hi, currently react-stacked-center-carousel indeed does not have autoplay functionality. However, you can create a function that utilizes setTimeout to call itself and ref.goNext() every few seconds. Thanks for your suggestion though! I am currently very busy with school and internship but I will definitely consider implementing auto-play once things start to slow down a bit for me.

Can you add this feature?

gmaiaciteve commented 5 months ago

Im developing a react web app and I achieved the autoplay by setting a useEffect for a Interval!

`useEffect(() => { const autoplayInterval = setInterval(() => { if (carouselRef.current) { carouselRef.current.goNext(); } }, 3500);

return () => {
  clearInterval(autoplayInterval);
};

}, []);`