Jump to content
Search Community

How can I access values of tween target?

Donatello666 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

i have an array of html-object i want to tween. 

 

e.g: array = $('.test'); 

 

<div class="test"></div>

<div class="test"></div>

<div class="test"></div>

 

each object has values for tweening:

 

e.g. $('.test')[0]._newPosition.x;

 

Now  I want to stagger them and get the tween-values from itself like:

 

TweenMax.staggerTo( $('.test'), 1, { x: {currentTween}.target._newsPosition.x, y: {currentTween}.target._newsPosition.y }, .02);  

 

Is this possible and if how?

 

THX...

Link to comment
Share on other sites

Hi mikel,

 

thanks for your solution. I already thought about that. The only point why i would not like to use this is:

 

each of my DIVs has the values stored inside. To use your approach i first have to iterate through the DIVs and fill the array and then tween them and i would like to do this without this extra step. 

 

I thought: "OK, if GSAP iterates through my DIVs to tween them, i could get the tween values in the same step".

 

But I will give it a try, its the best way so... THX a lot! ?

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