Jon L
Jon L

Reputation: 27

how to speed up flipclock and stop at a certain point?

I'm currently using Flipclock.js to start a counter when the user scrolls past a certain point.

I'm looking for a way to speed this up so it rapidly counts to a time (say 5 minutes, within 5 seconds) and then stop. Essentially I need more of an animation effect than an actual counter.

Has anyone had success with this? Is there something else I could be using to achieve this effect with the flipclock look?

This gif gives a good example of the speed I am looking for - though ideally would be more consistent

Upvotes: 1

Views: 690

Answers (1)

N-ate
N-ate

Reputation: 6933

Change the interval in the flipclock.js library.

    _setInterval: function(callback) {
        var t = this;
        t.interval = 100;// <-- add this
        t.timer = setInterval(function() {          
            t._interval(callback);
        }, this.interval);
    }

This addition makes it flip every 100 ms.

Upvotes: -1

Related Questions