Jump to content
Search Community

GSAP + ScrollTrigger + Next.js not working

BeginnerGsap2025 test
Moderator Tag

Recommended Posts

Posted (edited)

Hello, I am trying to animate a counter that animates a number from 0-x where x is some target number. The animation works but when I want it to happen on ScrollTrigger, it doesn't work. I followed GSAP guidelines and "Common Mistakes" but it still not working.

Expected result: The counter should animate when a user sees the number on different devices.


Actual result: The counter animates as soon as the page refreshes.


How to reproduce the problem:  Refresh the page or scroll to the bottom of the page then hit refresh and wait for 5 seconds then scroll up and the animation finishes.

 

EDIT: The stackbit URL to the demo mentioned in GSAP guidelines: https://stackblitz.com/edit/stackblitz-starters-rvhe3n?file=app/page.tsx

See the Pen page.tsx by edit (@edit) on CodePen

Edited by BeginnerGsap2025
Included demo link in comment because it not codepen but stackbit
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...