Jump to content
Search Community

Timeline Scroll animations dissapearing

weinde test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

I noticed a few things: 

  1. You're looping through each ".kartica", creating a ScrollTriggered animation for each one, but in EVERY one of those timelines you're animating ALL titles, subtitles and descriptions on the entire page. You didn't scope things so that you're targeting just the children of each individual ".kartica" element. So you've got a bunch of competing/conflicting animations.
  2. I noticed you've got CSS transitions applied. Never apply CSS transitions to anything that you're animating with JavaScript. It's horrible for performance because whenever the JS sets a property, the CSS will jump in and say "NOPE! I won't let you do that...I'm gonna stretch this change out over time" (and that happens 60 times per second on every animation). 

See the Pen QWVbyvL?editors=0110 by GreenSock (@GreenSock) on CodePen

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

10 hours ago, GreenSock said:

I noticed a few things: 

  1. You're looping through each ".kartica", creating a ScrollTriggered animation for each one, but in EVERY one of those timelines you're animating ALL titles, subtitles and descriptions on the entire page. You didn't scope things so that you're targeting just the children of each individual ".kartica" element. So you've got a bunch of competing/conflicting animations.
  2. I noticed you've got CSS transitions applied. Never apply CSS transitions to anything that you're animating with JavaScript. It's horrible for performance because whenever the JS sets a property, the CSS will jump in and say "NOPE! I won't let you do that...I'm gonna stretch this change out over time" (and that happens 60 times per second on every animation). 

 

 

Thank you so much for this.

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