Closed zakuni closed 6 years ago
Hi!
I think the counter doesn't reset the target property when it starts again. I'll try to fix this bug soon. Meanwhile, you can avoid this if you set the target to null:
timer.start({
startValues: [0,0,0,0,0],
target: null
});
You can check out an example here: https://runkit.com/albert-gonzalez/5b13aa3b4b531d0012d39ee3
Thank you!
Thanks!
It worked with setting target to null.
Actually I'd already tried it and somehow it wasn't working. And also, I was misunderstanding that typeof null is not 'object'. That's why I thought timer can not be reset or set to null, but now I understand it works.
Thank you for your working with reseting the target on start again!
Hi again, Kunio!
I published the version 2.2.2. Now it should reset startValues and target if you don't pass these params to the start function. I edited the previous example:
https://runkit.com/albert-gonzalez/5b13aa3b4b531d0012d39ee3
I hope it helps.
Best regards!
Cool! It worked! Thanks for your update!
Hi,
Is there a proper way to start counting up immediately after counting down to 0?
What I have done is something like this.
Once countdown is done, target is set to 0 as a default and it is kept(can not be reset or set to null) even after start timer with countup. I'm setting a target to avoid targetAchieved is dispatched every second and timer is started over again and again. But actually I don't want to set a target to countup timer.
Maybe I can achieve this with using two different timers(I haven't tried yet, though). But still I think it'll be cool to be able to do it with using one timer. What do you think? Or do you have any ideas?
Thanks.