Jump to content
GreenSock

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

Variable element target

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 timelines that are the same, but that are targeting different elements, I've set a codepen to show an exemple,

would there be a way to simplify the three functions and timelines into one with a kind of parameter ?

Because only a letter is differing one to another but I can't figure out how I could ...

 

Thanks a lot in advance,

 

Olivier

 

See the Pen vYBLbBY by alguna (@alguna) on CodePen

Link to comment
Share on other sites

3 hours ago, alguna said:

Because only a letter is differing one to another but I can't figure out how I could ...

 

Using a letter makes no sense. Numbers are your friend when it comes to repeating something... and so are loops. There are many ways to do a loop, and here is one. 

 

See the Pen c35a7a69af6a6db997249a6111e6f930 by osublake (@osublake) on CodePen


 

 

  • Like 6
Link to comment
Share on other sites

Thanks @OSUblake , it indeed makes more sense this way! :)

Regards,

 

Olivier

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