Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] Help with simple setTimeout() issue Re: [Solved] Help with simple setTimeout() issue

#65099
jamygolden
Member

I struggled with that for a while.

Here’s what I’m busy doing in PlusSlider.

// Define functions
clearTimer = function () {
// Clear the timer if it is set
if (timer) {
window.clearInterval(timer);
}
}
beginTimer = function () {
timer = window.setInterval(function () {
nextSlide();
}, 2000);
}

beginTimer();

// Pause on hover
$(this).hover(function () {
clearTimer();
}, function () {
beginTimer();
});