Jump to content
Search Community

Using the same GSAP Timeline to control multiple elements

lukestoked test
Moderator Tag

Go to solution Solved by Carl,

Recommended Posts

I want to have this timeline run and animate in the text coming up but I must be missing something obvious as I want each button to be controlled individually and not loop through all the buttons on screen when I hover on one of them.

 

Some pointers or guidance would be greatly appreciated.

See the Pen BavppeB by luke-stoked (@luke-stoked) on CodePen

Link to comment
Share on other sites

  • Solution

Hi and welcome to the GreenSock forums.

 

Thanks for the demo.

 

It looks like you are only creating 1 timeline with all the animations in it.

 

The approach I recommend is to create a timeline for each element and then that element can play and reverse its animation on enter/leave

 

here is a demo from a lesson in my Free GSAP Beginner's Course

 

See the Pen WNZLoNg by snorkltv (@snorkltv) on CodePen

 

Check out the course as it will get you up to speed with the latest syntax too.

 

TimelineLite still works but isn't recommended.

 

 

  • 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.
×
×
  • Create New...