Jump to content
Search Community

GSAP Timeline remove blank space onLoad

Jgoo321 test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi Team,


The codepen linked is one created by @OSUblake. I found this solution to a snap scroll concept I am implementing to work very well. There is one thing that I am trying to achieve that I seem to be heavily struggling on.


When the page loads or on page reload, how can I prevent the animation from taking effect on the first section? Essentially, I want section1 to be the page that the user first sees (without the section animating into the viewport), instead of the current effect it has now which is to "gotoSection(0,1)".



Johnny G.

See the Pen GRQKPMo by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

  • Solution

One quick way to do it is to just have the gotoSection() function return the timeline and then you can jump to the very end immediately with .progress(1):

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


There are other ways to do it too, of course, but this seemed like probably the simplest off the top of my head.

  • 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.
  • Create New...