You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 22, 2021. It is now read-only.
Hi, is possible to have the counter in a loop, in time interval. an e.g:
when scroll target to numbers, counter starts, from "0" to " 13.423";
and then, in five seconds (an eg), the counter resumes the count, from 0 to 13.423 again.
its possible? like a 'loop' with interval.
i want to use 1.300.000, but returns "NAn" for me.
how can i use this format of numbers??
Tks a lot!
The text was updated successfully, but these errors were encountered:
Crossposting here from #57 (comment) in case anyone finds it through Google and needs the same thing.
First, re-running the counter is kind of a hard question because it requires us to "stop" the looping once the screen scrolls off, so it can restart when it becomes visible again. AFAIK there is no such funcionality on library (Waypoints) Counter Up uses. You could simply run it in a loop forever every 5-secs after it finishes (it would start when the user scrolls and then will keep looping). This is subideal because if the user scrolls again it could be mid-counting and would not start from 0, but is the best you can right now. This change would require a somehow bigger modification to the code (some 6 or 7 lines, maybe). You would need to store the array with the numbers and run the current "shifting" process in a copy of this array, so you can reset the array later to re-run. You would enqueue the restart using the "else" that detects the end of the counting at line 65.
For the second question, currently Counter Up runs a "parseInt" in the data you input and it cannot really understand any complex masks (it accepts commas as thousands separator). But as the code store the pre-calculated data in an array, you can easily pass the number through a masking function before storing it at line 54 with
Hi, is possible to have the counter in a loop, in time interval. an e.g:
when scroll target to numbers, counter starts, from "0" to " 13.423";
and then, in five seconds (an eg), the counter resumes the count, from 0 to 13.423 again.
its possible? like a 'loop' with interval.
how can i use this format of numbers??
Tks a lot!
The text was updated successfully, but these errors were encountered: