Jump to content
Search Community

current value of a tween prop

tailbreezy test
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

Hello,

 

I am wondering is there a way to tell the current value of a tween prop ( say "x") before any tweening.

 

For example:

 

gsap.to(".class", { x: "+=100" }

 

// how to "properly" tell what x is before we add 100

 

I reckon it is target._gsap[prop], but is it expected to be used like that.

 

x: (_,t) => { 
      var val = t._gsap["x"];
      val = val ? parseFloat(val) : 0;
      return val + 100 

 

Is this what the engine does behind the scenes? Is this equivalent to "+="?

 

Cheers

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