Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Is it possible to change an array of target dynamically ?

Recommended Posts


Like you'll see in the codepen, my array of target is not updated. Is there a solution to do that ?
Thank you guys :)


See the Pen MwBoJY by anon (@anon) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.


The behaviour you're seeing is completely expected. One of many implementations that makes GSAP super fast is avoiding continuous read-write operations. So once an instance have been instantiated all that info is stored for faster access to it. So once you change your array, that change has no effect on any instance created before the array was updated.


Something similar was in discussion not too long ago, check the following link, I believe you'll find some helpful information there:




Let us know if you need something else.


Happy Tweening!!

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