I have a carousel plugin I've created and I need a way to have it run a function that moves the image to the side and brings in the next image. I have this working with navigation arrows but I want to implement a way for it to do this on its own.
I'm having trouble finding information on this as Google is bloated with everyone's carousel libraries.
Basically, I just need something like:
window.setTimeout(() => {
// do something
}, 1000);
But it needs to run over and over unless a particular event is triggered. My first thought was a while
loop but that would have been disastrous.
I don't have much to show but currently, this is the code:
let mouseIsOver = false;
inner.addEventListener('mouseenter', () => {
mouseIsOver = true;
console.log(mouseIsOver);
});
inner.addEventListener('mouseleave', () => {
mouseIsOver = false;
console.log(mouseIsOver);
});