Search code examples
jqueryhtmlcountdown

Keith-Wood Countdown count up after reaching 0


I'm using Keith Wood Countdown in order to display timer in my page. What i want is: start counting up when the counter reaches 0.

I can easily start the counter using until:

$('.digits').countdown({ until: tempsbefore, onTick: watchCountdown,alwaysExpire:true,format: 'DHMS',onExpiry: liftOff });

I tried to add this $('.digits').countdown({ since: tempsbeforemeetingends,format: 'DHMS'}); to the liftOff method but it doesn't work. Here is the code

function liftOff() { 

            var tempsbeforemeetingstart=<%=Temps_Avant_Seance%>
            console.log(tempsbeforemeetingstart)
            //$('.digits').countdown('destroy');
            $('.digits').countdown({ since: tempsbeforemeetingstart,format: 'DHMS'});
        }

Thanks in advance


Solution

  • Found a solution. I needed to call the countdown option parameter in the liftOff function instead of initializing it again.

    function liftOff() { 
    
         $('.digits').countdown('option', {since: tempsecoule});
        }