Next.js Discord

Discord Forum

Create carousel

Unanswered
Maltese posted this in #help-forum
Open in Discord
MalteseOP
Hello, folks! Do you know how I can make this sliding effect automated, without the need clicking on a <a/> tag to slide the images?

11 Replies

MalteseOP
I see the video is a little laggy, but you get the idea, the initial sliding was that what I want to be automated
@Maltese Hello, folks! Do you know how I can make this sliding effect automated, without the need clicking on a <a/> tag to slide the images?
If I would be you, I would use this library: https://www.embla-carousel.com/
You can easily create beautiful carousels with it and of course this kind of "automatic" function is also supported
MalteseOP
Yes, I know it, but I don't want to use it for now
oh ok 👍
Crested Myna
Do you want to integrate it with next router? Otherwise, I don't see the relevance here.
@Crested Myna Do you want to integrate it with next router? Otherwise, I don't see the relevance here.
MalteseOP
its just a carousel, why I have to implement it with next router?
@Maltese its just a carousel, why I have to implement it with next router?
Crested Myna
You don't have to. I was just wondering if you wanted the state of the carousel to be saved in the url.
Giant ichneumon wasp
Simple solution is to use a set interval to just do what the button clicks are doing every X seconds
Might be able to do it with css too, maybe an animation
MalteseOP
Update I used component library