Animates a numerical value by counting to it
Despite its name, CountUp can count in either direction, depending on the
endVal params that you pass.
CountUp.js supports all browsers.
The only file you need is countUp.js.
If you want to get fancy with build systems, a gulpfile is included. Read more here.
Included is an angular module. Use the count-up attribute to quickly create an animation. It also integrates nicely with the angular-scroll-spy directive. The Angular directive only requires an
end-val attribute, but will also accept
id is not needed. You must include both countUp.js and the module to use the angular directive. Check out the angular demo.
target= id of html element, input, svg text element, or var of previously selected element/input where counting occurs
startVal= the value you want to begin at
endVal= the value you want to arrive at
decimals= (optional) number of decimal places in number, default 0
duration= (optional) duration in seconds, default 2
options= (see demo, optional) formatting/easing options object
Decimals, duration, and options can be left out to use the default values.
var numAnim = "SomeElementYouWantToAnimate" 24.02 99.99;numAnimstart;
with optional callback:
numAnimstartsomeMethodToCallOnComplete;// or an anonymous functionnumAnimstart// do something
Reset an animation:
Update the end value and animate:
var someValue = 1337;numAnimupdatesomeValue;