Open sam-pudle opened 9 years ago
You haven't told the location of timer function. If you are using setInteval then you have to store the reference of that interval in a variable. On the next or previous button click you must clear previous interval and recall setInterval function.
For example
var myVar = setInterval(function(){ myTimer() }, 1000);
$('a.next').click(function (){ myStopFunction(); myVar = setInterval(function(){ myTimer() }, 1000); });
function myTimer() { var d = new Date(); var t = d.toLocaleTimeString(); document.getElementById("demo").innerHTML = t; }
function myStopFunction() {
clearInterval(myVar);
}
Ive set the slider to fade every 5000ms, if i count 3 seconds and then forward the slider manually using
$('a.next').click(function () { $slides.data('superslides').animate('next'); });
The next slide only lasts for 2000ms before moving on, it would seem the timer isnt resetting when the slide is manually moved.