Reply To: Hide counter when it has ended

Author
Reply
  • #1328

    You can do that using something like this:

    var stceClockSimple = jQuery("#stac-dev-simple").smartTimerCounter({
        mode: "Counter",
        callbacks: {
            finished: function() {
                this.core.$obj.hide();
            }
        },
        model: {
            method: "seconds",
            value: 5
        }
    });

    This is full example, change what you need. As you can see ‘callbacks’ have finished callback set to hide the main HTML tag counter is applied on when the counter finishes, in this case counter is set to countdown for 5 seconds.

    The problem here is if you use countdown to a specified date, let’s say 2014 January 21. When counter reaches target on screen, it will run finished. But if you visit page on the next day, it will show counter with all 0 value, but in that case finished is not reached. This will be changed in 2.2 version (in a day or two) that will check target completion before starting the clock and it will execute finished as it should be.

    Milan