Answer the question
In order to leave comments, you need to log in
How can I reset the timer and then start it again?
There is a condition after the satisfaction of which the timer needs to be cleared, and when the condition is not satisfied, start again.
For example: if (StateStnum_1!= stnum_1) { interval should work. And if the condition is met and StateStnum_1 === stnum_1 interval should be cleared...
The code is complete:
var intervaled = setInterval(function() {
if (StateStnum_1 != stnum_1) {
StateStnum_1++;
flip('hoursUp' + 1, 'hoursDown' + 1, StateStnum_1, 'Single/Up/' + 2 + '/', 'Single/Down/' + 1 + '/');
if (StateStnum_1 === 10) {
StateStnum_1 = 0;
}
};
}, 1500);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question