counting down
Demo is presented at http://misha-panyushkin.github.io/clocks.js/
To create a new clocks just find the container and apply count method to the element(s). Simply container is single DOM element, but it could be a set of elements. The clocks instance'll be added to each one.
var clocks = $("#clocks").countDown(int);
int
- the time to count it down in milliseconds.
Benefit is structure.
.fill(int);
.getTime();
.resume();
.start([int]);
.stop([int]);
###simply are:###
- Stop current count if it's running & filling out the clocks instance with new time;
- Return remain time to go;
- Resume counting if it has been stopped before;
- Start new count in case
int
is pointed out or simply resume previous; - Stop current count & fill it with new value if needed.