SWALKER Posted October 16, 2022 Share Posted October 16, 2022 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 More sharing options...
Solution alig01 Posted October 16, 2022 Solution Share Posted October 16, 2022 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 3 Link to comment Share on other sites More sharing options...
SWALKER Posted October 17, 2022 Author Share Posted October 17, 2022 Oh wow you're right. Maybe because I used the same classes twice? Thank you so much! I never would have got that, I assumed it was an error elsewhere You're a star - Thank you! 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now