25 lines
426 B
JavaScript
25 lines
426 B
JavaScript
$(document).ready(function(){
|
|
|
|
$('.counter').each(function() {
|
|
var $this = $(this),
|
|
countTo = $this.attr('data-count');
|
|
|
|
$({ countNum: $this.text()}).animate({
|
|
countNum: countTo
|
|
},
|
|
|
|
{
|
|
|
|
duration: 3000,
|
|
easing:'linear',
|
|
step: function() {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function() {
|
|
$this.text(this.countNum);
|
|
//alert('finished');
|
|
}
|
|
});
|
|
});
|
|
});
|