diff --git a/README.md b/README.md index 29ff22e..8a7f223 100644 --- a/README.md +++ b/README.md @@ -51,5 +51,8 @@ Options * `separators` _boolean_ if true, all arbitrary characters inbetween digits are wrapped in seperated elements. if false, these characters are stripped out +* `maxValue` _int_ + maximum value after the ticker would stop ticking + * `autostart` _boolean_ whether or not to start the ticker when instantiated diff --git a/assets/js/tick.js b/assets/js/tick.js index 78a9564..4240a1e 100755 --- a/assets/js/tick.js +++ b/assets/js/tick.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.3 forked from harvesthq, novovic edit. (function() { var $, Tick, Tick_Flip, Tick_Scroll, _ref, _ref1, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, @@ -49,6 +49,7 @@ separators boolean if true, all arbitrary characters inbetween digits are wrapped in seperated elements if false, these characters are stripped out autostart boolean whether or not to start the ticker when instantiated + maxValue int maximum value after the ticker would stop ticking Events @@ -84,7 +85,7 @@ return option; } else if (typeof option === 'number') { return function(val) { - return val + option; + return val + this.options.incremental; }; } else { return function(val) { @@ -156,8 +157,14 @@ Tick.prototype.tick = function() { this.value = this.increment(this.value); - this.render(); - return this.set_timer(); + if (this.value >= this.options.maxValue) { + this.value = this.options.maxValue; + this.render(); + return this.stop(); + } else { + this.render(); + return this.set_timer(); + } }; /*