There are so many different counter scripts I'm not sure where to start, what's overkill and what's not.
I'm looking for a simple counter script that fires when the target element first appears into view onscreen (for example, does not fire until scrolled into view)
The idea is that all I have to do to get the element to animate/count when scrolled into view, is give it a class of counter
.
For example, html will be:
<span class="counter">99</span><span class="counter">55</span>
First, those elements would be set to visibility:hidden
until scrolled into view. Then, they would increment from 0 to the value of the text node (99 and 55 in this case) and stop when they reach the value. Some sort of ease out effect may be desirable but isn't a must (for example, start fast and slow down as it reaches the value)
Thanks in advance. Just looking for the simplest solution.