Animated change the number in real time?

On the page there is a div that contains a number. This number is added from a php file (using include), but in php file the number of hits from the database. DB>>>php file>>>page. div that contains the number is updated every 3000мс.

With this code number on the page animated: (the number is counted from 1, for example, 1,2,3,4 and until will be displayed the number itself)
$(window).scroll(startCounter);
function startCounter() {
 if ($(window).scrollTop() > 3000) {
 $(window).off("scroll", startCounter);
 $('.Count').each(function () {
 var $this = $(this);
 jQuery({ Counter: 0 }).animate({ Counter: $this.text() }, {
 duration: 4000,
 easing: 'swing',
 step: function (now) {
 $this.text(now.toFixed(2)); 
}
});
});
}
}

When database is changing the number accordingly, and change it in php file, and hence on the page, but changing it without animation.

How to make it varied with animations, at least in a big way?
July 2nd 19 at 17:17
0 answer

Find more questions by tags Web DevelopmentHTMLJavaScript