Jump to content
Search Community

Don't know how to incorporate multiple animations for one variable in nest timelines.

Susan 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

I am having problem to understand how to bind multiple animations into one variable which is in nest timelines.

 

What I would like to achieve is a looping variables like this codepen:

 

See the Pen symha?editors=0110 by GreenSock (@GreenSock) on CodePen

 

But with multiple animations for one/first variable (box1Timeline) like this, mentioned by @OSUblake

 

Kindly assist, thank you!

See the Pen XVWdoZ by susansiow (@susansiow) on CodePen

Link to comment
Share on other sites

You had undefined variables in your demo that is why it wasn't working. You should look into how to debug JavaScript. Again the videos I had suggested, they walk you through all the basic details about how you can chain animations and last two videos show advanced approach of using functions for complex animations.

 

See the Pen qpBNXz?editors=0010 by Sahil89 (@Sahil89) on CodePen

 

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

GSAP part of your demo is correct, I don't see any issues.

 

You are redefining 'target 'variable by using 'var' which is incorrect, it will still work in most browsers but it can throw error in some rare cases. You can reuse same variable without using 'var', though it is better practice to use unique variables for each element.  Plus when you are using editor you will see squiggly lines telling you something is wrong in your code.

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