Jump to content
GreenSock

Premium Funding

ScrollTrigger Activate Counter

Moderator Tag
Go to solution Solved by Cassie,

Recommended Posts

Hi GSAP Guys, 

I am trying to get this to work. When you scroll down the number counter activates when section comes in to view, then starts the counting up of the numbers.

But this isn't working, I know something is wrong but can't figure it out.

See the Pen xxYLjYq?editors=1011 by james182 (@james182) on CodePen

Link to comment
Share on other sites

  • Solution

Heya! *Guys (and Gals) over here.

So I see what you were trying to do over here! Makes perfect sense. But those functions were being called immediately. You can pop those function calls into another function that only gets called when the callbacks fire.

See the Pen yLvoqmr?editors=0011 by GreenSock (@GreenSock) on CodePen

 

Alternately just pull it out into it's own ScrollTrigger

See the Pen eYVEjXw?editors=0011 by GreenSock (@GreenSock) on CodePen

 

Hope this helps!

  • Like 2
Link to comment
Share on other sites

  • 5 months later...
10 hours ago, tomektomczuk said:

Now, this animation shows NAN for enter back

That's an issue with the jQuery animation. I'd recommend eliminating jQuery and just use GSAP/ScrollTrigger in this simplified fashion: 

See the Pen ExRyOOJ?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Does that help? 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

@GreenSock Thank you!
It should work every time it is scrolled.
Also, all objects with the same class had to work.
This is how I updated it.

 

See the Pen zYLBgBw by sawacrow (@sawacrow) on CodePen

 

  • Like 1
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.
×