objectivehtml / FlipClock

http://flipclockjs.com/
MIT License
2.74k stars 954 forks source link

Counter increments #80

Closed tomolas closed 10 years ago

tomolas commented 10 years ago

How would you make the basic counter example to count in increments different than 1?

fredw commented 10 years ago

I have the same doubt. I would like to make a counter incrementasse as provided number, something like:

var counter = $('.counter').FlipClock(100, {clockFace: 'Counter'});

setTimeout(function() {
    setInterval(function() {
        counter.increment(10);
    }, 1000);
});
objectivehtml commented 10 years ago

You can set the value to anything you want. Just check the faces/counter.js to reference the available methods.

 // Instantiate a counter
clock = $('.clock').FlipClock(0, {
    clockFace: 'Counter'
});

// Attach a click event to a button a increment the clock
$('button').click(function() {
    clock.setValue(10);
});