I’m having a setTimeout problem similar to this one. But that solution doesn\'t help me since I can’t use php in my file.
My site has a slider with a list of images
You must also think you use clearTimeout.
As you call setTimeout function it returns an ID you can save this ID in a variable like
timeoutID = setTimeout(function () { spotlight.animate(spotlight.i); }, 8000);
and before setting a new timeout you can call the function like
clearTimeout(timeoutID)