STYLE SWITCHER

A simple jquery counter

Screen-Shot-2015-04-27-at-9.22.33-AM
function counterSetup(){

$.fn.counter = function (options,callback) {
var callback = callback || "";
var self=$(this);
var defaults = {limit:100,speed:1000}
options = $.extend(defaults, options);
$({ value: self.text() }).animate({ value: options.limit }, {
duration: options.speed,
easing: 'linear',
step: function () {
self.text(Math.floor(this.value));
},
complete: function () {
if(callback!="")
callback();
}
});
}
}
counterSetup();
 
Counter initiate
$('#count-1 span').counter({limit: 2007, speed: 1000});

Recent Article

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Keep your skills sharp, get informed.

    Subscribe to our mailing list and get interesting stuff and updates to your email inbox