$( function() {
// Add background image
$.backstretch('images/road2.jpg');
var endDate = "June 25, 2020 00:00:00";
$('.countdown.simple').countdown({ date: endDate });
$('.countdown.styled').countdown({
date: endDate,
render: function(data) {
$(this.el).html("
" + this.leadingZeros(data.days, 3) + " days
" + this.leadingZeros(data.hours, 2) + " hrs
" + this.leadingZeros(data.min, 2) + " min
" + this.leadingZeros(data.sec, 2) + " sec
");
}
});
$('.countdown.callback').countdown({
date: +(new Date) + 10000,
render: function(data) {
$(this.el).text(this.leadingZeros(data.sec, 2) + " sec");
},
onEnd: function() {
$(this.el).addClass('ended');
}
}).on("click", function() {
$(this).removeClass('ended').data('countdown').update(+(new Date) + 10000).start();
});
});