flipcountdown icon indicating copy to clipboard operation
flipcountdown copied to clipboard

Is it possible to install a handler for when countdown reaches 0 or something similar?

Open sharky93 opened this issue 11 years ago • 2 comments

Cannot find anything in the docs.

sharky93 avatar Jul 14 '14 13:07 sharky93

You can use the tick.

Example:

$(function(){ var NY = Math.round((new Date('7/25/2014 22:00:00')).getTime()/1000); $('#i405').flipcountdown({ size:'sm', tick:function(){ var nol = function(h){ return h>9?h:'0'+h; } var range = NY-Math.round((new Date()).getTime()/1000), secday = 86400, sechour = 3600, days = parseInt(range/secday), hours = parseInt((range%secday)/sechour), min = parseInt(((range%secday)%sechour)/60), sec = ((range%secday)%sechour)%60; if (range <=0){

alert("Countdown has Reached 0!"); return; }

            else{
    return nol(days)+' '+nol(hours)+' '+nol(min)+' '+nol(sec);
    document.getElementById("countdown_complete").style.visibility="hidden";}

}

});

});

gatoona avatar Jul 18 '14 21:07 gatoona

This doesn't work and stays in the if clause and keeps on showing the alert

farzadso avatar Mar 15 '17 06:03 farzadso