Personally, how can I load the contactor only when the element is on the screen?
('.count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 4000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
This is in the middle of the page, until it reaches the animation already finished
<!-- num items -->
<div class='col-sm-3'>
<div class='num-items'>
<span class='lnr lnr-rocket'/>
<p class='counter_up'>1000</p>
<h6>Amostra1</h6>
</div>
</div>
<div class='col-sm-3'>
<div class='num-items'>
<span class='lnr lnr-smile'/>
<p class='counter_up'>164</p>
<h6>Amostra2</h6>
</div>
</div>
<div class='col-sm-3'>
<div class='num-items'>
<span class='lnr lnr-layers'/>
<p class='count'>964</p>
<h6>Amostra3</h6>
</div>
</div>
<div class='col-sm-3'>
<div class='num-items'>
<span class='lnr lnr-coffee-cup'/>
<p class='count'>376</p>
<h6>Amostra4</h6>
</div>
</div>
</div>
</div>
</div>
<!-- ====== End Numbers ====== -->