-2
My intention is to make a countdown timer in javascript, even if no one is on the site the timer continues to count unbelievably.
How can I do that?
Thank you.
-2
My intention is to make a countdown timer in javascript, even if no one is on the site the timer continues to count unbelievably.
How can I do that?
Thank you.
1
"timer decreasing in javascript, even if no one is on the site the timer continues to count unbelievably"
Why use a timer then? you can use the current date and decide what to do. For example, taking colors into account:
var cores = ['#faa', '#afa', '#aaf'];
you can then know how many minutes of such a day have passed and do some math...
var agora = new Date();
var minutosEsteDia = (agora.getHours() * 60) + agora.getMinutes();
var meiasHoras = minutosEsteDia / 30;
var cor = Math.round(meiasHoras % (cores.length - 1));
Now you’ve given me the position 2
, ie: #aaf
. Let’s see what happens in half an hour :)
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
It can be with Nodejs even.
– Gonçalo
So when you have a code for how you tried, with any problem or doubt, you can edit your question, mcve.
– Renan Gomes
By the way, if you want to do Javascript with you, as long as someone is always on the right site?
– Gonçalo
Just to reinforce: MVCE
– Berriel