Jump to content
Search Community

Animation ending before all cards are animated

raffi23 test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

Hey guys I am trying to create a scroll effect where scrolling would cause the cards to move down-left but my problem is that the animation is not ending where it should (where all cards have been shown).

 

I tried adding

 

{ end: "+=2000" }

 

but it is only making the animation slower.

 

Can you help me fix this bug?

See the Pen QWXLNpr by raffiwebdev (@raffiwebdev) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @raffi23 welcome to the forum!

 

The best thing to do when working with ScrollTrigger is to remove it! This seems counter intuitive, but ScrollTrigger is just animating something on scroll, so just focus on the animation at first and only when you're happy with the animation add ScrollTrigger back in. This way you can focus on one part at a time and it will save a lot of headache when debugging. 

 

Below your demo with ScrollTrigger disabled and  GSDevTools so we have a way to inspect the animation and as you can see your animation is not doing what you want, so your ScrollTrigger will never be able to fix your animation, it is just playing the animation you've build, but using the visitors scrollbar as the progress bar. 

 

See the Pen xxoKqVj?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen

 

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