Skip to content

Instantly share code, notes, and snippets.

@tombruijn
Last active March 31, 2016 07:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tombruijn/6134393 to your computer and use it in GitHub Desktop.
Save tombruijn/6134393 to your computer and use it in GitHub Desktop.
Counter.js example configuration
$("#counter").counter({
autoStart: false, // true/false, default: true
duration: 5000, // milliseconds, default: 1500
countFrom: 10, // start counting at this number, default: 0
countTo: 30, // count to this number, default: 0
runOnce: true, // only run the counter once, default: false
placeholder: "?", // replace the number with this before counting,
// most useful with autoStart: false. default: undefined
easing: "easeOutCubic", // see http://gsgd.co.uk/sandbox/jquery/easing
// for all available effects, see visual examples:
// http://easings.net
// default: "easeOutQuad"
onStart: function() {}, // callback on start of the counting
onComplete: function() {}, // callback on completion of the counting
numberFormatter: // function used to format the displayed numbers.
function(number) {
return "$ " + number;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment