Jump to content
Search Community

How to slow down ScrollTrigger fromTo animations

Gabor Ferencz test
Moderator Tag

Go to solution Solved by Gabor Ferencz,

Recommended Posts

I would like to get help, on how to slow down ScrollTrigger fromTo animations.

 

The goal is to increase the duration of the animations (and the positon of the last fromTo), and this will make the animations slower.

Since scrub turned true (to control the animation with the scrolling), the duration property does not have any effect.

 

What am I missing?

 

Thank you in advance for your help! :) 

 

tl = gsap.timeline({
  scrollTrigger: {
    trigger: '.feature-holder',
    scrub: true,
    pin: true,
    pinSpacing: true,
    markers: false,
  },
});

tl
  .fromTo(
    '.feature-overlay',
    {
      autoAlpha: 0,
    },
    {
      autoAlpha: 0.25,
      duration: 3,
    },
  )
  .fromTo(
    '.feature-text',
    {
      autoAlpha: 0,
      y: 5,
    },
    {
      autoAlpha: 1,
      y: 0,
      duration: 1,
    },
    '>',
  )
  .fromTo(
    '.feature-text',
    {
      autoAlpha: 1,
    },
    {
      autoAlpha: 0,
      duration: 1,
    },
    '>+=10',
  );

 

 

Link to comment
Share on other sites

  • Solution

Thanks, Cassie!

I figured out the solution. Add start and end properties solved the issue. :)

start: 'top top',
end: '+=1000%',

Now the timeline length (this way the duration length as well) can be controlled by the distance between the start and end. With +=1000% it slowed down the animations.

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