bde-liste/static/js/main.js
2022-12-15 14:30:34 +01:00

23 lines
No EOL
521 B
JavaScript

$(window).on("load", function() {
/* load timer */
window.setInterval(function() {
var time = $("#timer").text();
var t = time.split(":").map(t => parseInt(t));
t[2] -= 1;
if (t[2] < 0) {
t[2] = 59;
t[1] -= 1;
}
if (t[1] < 0) {
t[1] = 59;
t[0] -= 1;
}
if (t[0] < 0) {
t[0] = 0;
t[1] = 0;
t[2] = 0;
}
$("#timer").text(t.join(":"));
}, 1000);
});