$('.count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 5555,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
function start_count() {
$('.count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 5555,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
}
$(function() {
var oTop = $('.count').offset().top - window.innerHeight;
$(window).scroll(function(){
var pTop = $('body').scrollTop();
if( pTop > oTop ){
start_count();
}
});
});