Auto play in slider is an API job or a pure vanilla JS

I can now create click-based JS sliders. Now I want to give it a try to auto-play sliding.
is this a pure Vanilla JS job or some API can be used. Observation Intersection API, for example, is used to find out of element is present in the viewport.

Please advise what should I explore, further.

If you have a slider which you can click to show the next slide, then an autoplay function should be as simple as using a timer which calls the nextSlide method at regular intervals.

You’ll also likely want to keep track of which slide the user is viewing, so that the slider can loop back to the start once it reaches the final slide.

I don’t think any web APIs will help you much here.

1 Like

Thank you so much for taking care @James_Hibbard by replying. I will try to build on that line where vanilla JS is to be used and will update you on the outcome.