Jump to content
Search Community

Why does the animation move first before windows finishes loading?

Bayu Handono test
Moderator Tag

Recommended Posts

Hiya - 

Your loader isn't tied to any loading state at all - it's simply a delayed tween that's fading a black div.

The following animations also don't have any association with that loader or the imaginary loading time at all.

Their starting points are triggered when a specific scroll point is passed - on page load the first element's trigger point is already passed - so the animation plays immediately.

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



If you'd like to wait until the user scrolls you could clamp your triggers? You'll need to update to a more recent version though, your pen is using old versions of GSAP & ScrollTrigger.

 

https://gsap.com/blog/3-12/#:~:text=Clamp Your Triggers,where your triggers are placed.

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



Alternatively - you could refactor so that all the images below the fold are triggered by scrollTrigger but the top image and the loader are on a timeline.

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

 

Hope this helps!

 

  • Like 2
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...