Jump to content
GreenSock

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

hook up two functions containing separate timelines inside EventListener

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