jqueryjquery-countdown

Jquery countdown warn user 5 minutes before time over


I'm using Jquery countdown in my project (http://hilios.github.io/jQuery.countdown/). I want to warn user 5 minutes before the end the counter (displaying an alert) and 10 minutes after the end of the counter . In the website documentation i saw that, there is a an event called elapsed giving the information that time is over.

Any suggestions please? My guess is that i have to work with the event call finaldate.


Solution

  • Problem fixed. To warn user , i used the offset.minutes event on update callback. Here is the code

    flag2 = true;
    
    $('#clock').countdown(dateseance, { elapse: true }).on('update.countdown', function (event) {
    
                    if (event.offset.minutes == (4) && flag2) {
                        alert("Less than 5 minutes before the end of counter");
                        flag2 = false;
                    }
    

    We use flag2 to display alert only once. So when the counter get 4mn 59 s the alert will be displayed.