Tell me what I was wrong.
I do it here http://landing.romza.ru , but my numbers run in a circle, and do not stop, reaching the maximum value ((
$(window).scroll(function() { $('.p1').each(function(){ var imagePos = $(this).offset().top; var topOfWindow = $(window).scrollTop(); if (imagePos = topOfWindow+600) { $(this).animateNumber({ number: 10 }); } }); });
UPD:
This script works correctly, but it starts immediately when the page loads. How to start it when scrolling to the element?
$('.num').countTo({ from: 0, speed: 100, refreshInterval: 1, formatter: function (value, options) { return value.toFixed(options.decimals); } });
=
double equals==
. You can read: developer.mozilla.org/ru/docs/Web/JavaScript/Reference/… - Ihor Tkachuk