Hello everyone,
I am working on the pomodoro project, but I cannot seem to get the clock to stop after the allotted time. After the time runs out, it starts counting upwards. Also, I have tried to make the break timer start when the work timer stops, but this doesn’t seem to work either. I have been using the flip clock.js api. I posted about this earlier, but no one has responded after a week, so I thought I would post again.
Here is the codepen:
Any help is deeply appreciated!
Thanks !
You are missing .time:
$("#btn1").on("click", function() {
clock.setCountdown(true);
clock.start(function() {
if (clock.getTime().time === 0) { // <-- your are missing .time
clock.stop();
}
...
...
Thanks for the help! I have managed to get the break clock to start at the end of the work clock’s time, but now I am having trouble getting the break clock to stop. Can you help me with this? Here is the codepen link:
Thanks again!
You are using external API and their site http://flipclockjs.com is currently down.
If you can provide the documentation how to use it, I’ll look into it.