Jump to content
Search Community

hook up two functions containing separate timelines inside EventListener

chris maki 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 there. New to the forum here. I searched for the answer here, but didn't find the answer so here goes. I am newer to js, but I am looking for gsap related answers not js. Just throwing that out there. I created a multi-step form using gsap. Here is  smaller working portion of it.

 

I created several small functions each containing their own timelines. I am using the functions inside EventListeners to show and hide fieldsets. Each function is passing arguments. 

 

Is there a way to connect multiple functions into one timeline? I am seeing strange behavior--I assume because of the multiple timelines firing. 

 

I tried using .add() but maybe I was doing it wrong. 

 

Also could I use .reverse() to reuse the same functions in reverse if a previous button were to be clicked.(sorry snuck that in there even though it may be off topic).

 

Let me know if this is enough info. The pen has decent comments. Didn't want to add a heaping helping of snippets. 

See the Pen ggmBqL by chrisMaki (@chrisMaki) on CodePen

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