html:
css:
.flexW{display:flex;justify-content: space-between;}
.num{width:23%;}
js:
$.fn.numChange = function(){
var _this = this;
$(window).scroll(function(){
if($(window).scrollTop()>(_this.offset().top-$(window).height()-100)){
if(!_this.attr('data-change')){
_this.find('.num').each(function(){
let endNum = $(this).text()*100,
startNum = 0,
time = 100,
speed = 30,
addNum = Math.round(endNum/time),
_this = $(this);
_this.text(0);
var numChange = setInterval(function(){
startNum += addNum;
_this.text(Math.round(startNum/100));
if(startNum >= endNum){
clearInterval(numChange);
}
},speed)
});
}
_this.attr('data-change','true');
}
});
}
$('.flexW').numChange();
$(window).trigger('scroll');