1
I wonder if there is any plugin to do this timer same as this page for example:
http://dotrex.co/theme-preview/aimer-wedding/
If you have any example or link for consultation I would also be grateful.
1
I wonder if there is any plugin to do this timer same as this page for example:
http://dotrex.co/theme-preview/aimer-wedding/
If you have any example or link for consultation I would also be grateful.
2
I think something like that should work for what you need:
var data = '2016/02/28';
var falta = (new Date(data).getTime() - new Date().getTime()) / 1000;
var segundos = Math.round(falta % 60);
var minutos = Math.round(falta / 60 % 60);
var horas = Math.round(falta / 60 / 60 % 24);
var dias = Math.round(falta / 60 / 60 / 24);
var divs = document.querySelectorAll('div');
setInterval(function () {
if (segundos == 0) {
segundos = 60;
minutos--;
}
if (minutos == 0) {
minutos = 60;
horas--;
}
if (horas == 0) {
horas = 24;
dias--;
}
segundos--;
var contador = [dias, horas, minutos, segundos].forEach(function (parcela, i) {
divs[i].innerHTML = parcela;
});
}, 1000);
Alternatively you can use the plugin that is used on the page you mentioned: http://hilios.github.io/jQuery.countdown/
Browser other questions tagged javascript html5 css3
You are not signed in. Login or sign up in order to post.
http://hilios.github.io/jQuery.countdown/
– Sergio
the javascript code of that answer maybe it’ll help
– Pedro Sanção