Jump to content
Search Community

GSAP animation will only fire on the first instance

SWALKER test
Moderator Tag

Go to solution Solved by alig01,

Recommended Posts

I am trying to do a simple animation of an image sliding in when an accordion is clicked

 

I found a similar example and have done my best to edit it. The first panel works exactly how I want, but no other panels do, even if they are the first one opened on page load and I can't see the error.

Any help greatly appreciated

See the Pen vYjMOYw by shereewalker (@shereewalker) on CodePen

Link to comment
Share on other sites

  • Solution

Hey,

 

while looking over it, I noticed that I couldn't find your class names anywhere. After adjusting them, the animation worked as intended.

let groups = gsap.utils.toArray(".accordion-wrap");
let headers = gsap.utils.toArray(".acc_title");

Good look

 

 

 

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