I’ve found numerous resources about getTimer() and stuff but I can’t get a grip on the function. I want to create a very simple countdown timer where the total time is 10min and when you press a button it starts counting down and if you press another button it pauses and if you click again resumes the countdown! Furthermore if not too complicated I want to show the seconds as well, for example 9min 40sec etc.
Appreciate it kax! There is a wierd thing with the timer! When you press start it adds 59sec and then counts down! Also when it changes from 9:00 to 8:59 it first does 9:00->9:59->8:59!
countdown = function () {
ss > 0 ? ss -- : clearInterval(countdowni);
s = ss%60;
s < 10 ? s = "0"+s : null;
s == 59 ? m -- : null;
countdownBox.text = m+":"+s;
}
sorry :-\ … just replace the function and it should work fine now =)