Jump to content
Search Community

Counting numbers with separator (thousands)

droolcup test
Moderator Tag

Recommended Posts

Hey there,

 

I am animating several figures on a website. Now I have to add points as separators for thousands ("25.000" instead of "25000" and so on).

 

Sadly, since my JS knowledge is that of an absolute beginner, I didn't manage to reverse engineer the solutions presented in this topic: 

 

 

 

I am also using jQuery btw.

 

Any help to make this compatible with my code is very much appreciated!

 

Thanks in advance.

 

See the Pen zYGjPaM by droolcup (@droolcup) on CodePen

Link to comment
Share on other sites

  • 3 weeks later...

Hi fellow greensockers, 

 

I'm trying to achieve this animation on my homepage. But can't workout how to have it activate(trigger) on scroll.

I'm using the codepen example above and changed by selectors, when i refresh it works. But not on scroll of that section of the page?

 

Screen Shot 2020-04-06 at 11.51.29 AM.png

Link to comment
Share on other sites

Hey @AaronP and welcome to the GreenSock forums! 

 

For now, in order to get an animation to fire on scroll, you need to use either the intersection observer API or keep track of the scroll location. For how to use the intersection observer API, one of our moderators wrote this helpful post.

 

GreenSock is actually working on a new scroll-based plugin that will make this effect even easier to implement! 

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...