Jump to content
Search Community

Tween's initial value applied before trigger in ScrollTrigger

didkumi test
Moderator Tag

Recommended Posts

Is this a normal behavior? for anim tween's property to be set before it is called?

I expect the initial value to be a value I've set in the dom but during the first scroll enter "#circle2" already has radius which I have no idea how to resolve. I've tried setting a fromTo tween and set immediateRender to false but won't work. I thought I read forums saying gsap will always try to start  from an initially set value.. Can anyone help? 

See the Pen LYxvrOp by 1jiky (@1jiky) on CodePen

Link to comment
Share on other sites

Hi,

 

The set() instance you're creating is actually active, so as soon as the browser finish going through the code, the circle's radius attribute is updated. That instance has to be paused:

const anim = gsap.set("#circle2", {
  attr: { r: 330 },
  paused: true,
  immediateRender: false
});

Happy Tweening!!!

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