39 | This is a simple example of the 40 | jQuery countTo plugin 41 | created by Matt Huggins. Refer to 42 | the full documentation for more usage information. 43 |
44 | 45 |51 |
miles
59 |Lift-off in
67 |m/s2
75 |83 |
Option | 90 |Data Attribute | 91 |Description | 92 |
---|---|---|
from | 95 |data-from | 96 |The number to start counting from. (default: 0) | 97 |
to | 100 |data-to | 101 |The number to stop counting at. (default: 100) | 102 |
speed | 105 |data-speed | 106 |The number of milliseconds it should take to finish counting. 107 | (default: 1000) | 108 |
refreshInterval | 111 |data-refresh-interval | 112 |The number of milliseconds to wait between refreshing the counter. 113 | (default: 100) | 114 |
decimals | 117 |data-decimals | 118 |The number of decimal places to show when using the default 119 | formatter. (default: 0) | 120 |
formatter (value, options) | 123 |A handler that is used to format the current value before rendering to
124 | the DOM. The true current value and options set is passed to the
125 | function, and it is run in the context of the DOM element. It must
126 | return the formatted value. (default:
127 | value.toFixed(options.decimals) ) |
128 | |
onUpdate (value) | 131 |A callback function that is triggered for every iteration that the 132 | counter updates. The currently rendered value is passed to the 133 | function, and it is called in the context of the DOM element. 134 | (default: null) | 135 ||
onComplete (value) | 138 |A callback function that is triggered when counting finishes. The 139 | final rendered value is passed to the function, and it is called in the 140 | context of the DOM element. (default: null) | 141 |
start | 153 |Resumes the timer if it is stopped. | 154 |
stop | 157 |Stops (pauses) the timer if it is running. | 158 |
toggle | 161 |Starts or stops the timer based upon its current state. | 162 |
restart | 165 |Restarts the timer at its initial "from" value. | 166 |