Jump to content
Search Community

Scrub Timing

fourbier

Go to solution Solved by Rodrigo,

Recommended Posts

Posted

I need help understanding the timing of my scrubbed Scrolltrigger. Why is the third image not following the second one?
Where is my mistake? Thank you so much.
Fourbier 


See the Pen empwMRw by Georges-F-the-scripter (@Georges-F-the-scripter) on CodePen.

  • Solution
Posted
2 hours ago, fourbier said:

I can solve the problem by setting ease: linear. Weird.

Actually it makes perfect sense. By default all GSAP Tweens have a power1.out easing function applied to them:

https://gsap.com/docs/v3/Eases

 

That means the animation starts a bit faster and end slower, so when the animation is at 50% of it's duration in seconds, the actual progress is not 50%

 

I forked your demo and removed the ScrollTrigger part of it and added GSDevTools so you can scrub back and forth and see it for yourself, all you have to do is uncomment the ease in the defaults object:

See the Pen XJmLBrQ by GreenSock (@GreenSock) on CodePen.

 

Finally if you want to apply the same setting to all the instances in your Timeline you can use the defaults config option:

https://gsap.com/docs/v3/GSAP/Timeline#setting-defaults

 

Also is worth noticing that the default duration of a GSAP Tween is 0.5 seconds, so this is not really needed:

tl.fromTo(
  img_wusch[0],
  { x: 0 },
  { x: -halfWidth, duration: 0.5, },
  "0"
)

Hopefully this clear things up

Happy Tweening!

Posted

Thank you, Rodrigo! I really love GSAP and ScrollTrigger and all those things. Sometimes, though, I just wish the docs were a bit easier to browse.... 
(I may be  a bit old fashioned : )

Posted
11 hours ago, fourbier said:

Sometimes, though, I just wish the docs were a bit easier to browse.... 

Sorry to hear this 😞

 

Anything in particular that is making going and finding information in the docs difficult for you? We thrive in making learning GSAP and finding relevant information as simple as possible. We aim to make the life of our users easier not the other way around, so they can focus on creating amazing stuff.

Posted

I really don’t mean this as a complaint. It may be simply due to the complexity of the library that it's sometimes hard to find the proper definition, if you don't use it regularly... (where is the "vars-object"? do I need quotes or not? is it "+1000" or "+=1000"... : )

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