pietM Posted April 13, 2021 Share Posted April 13, 2021 Hi everyone, I've reviewed examples from the forum on how to achieve a simple vertical accordion. But, I can't get the heights to reset once I adjust the window dimensions. I know I have to recalculate the heights and reinitiate the animation function, but it keeps breaking. I appreciate your help. M See the Pen QWdQexQ by evryali (@evryali) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted April 13, 2021 Share Posted April 13, 2021 Hi, Yeah, responsive vertical accordions are not the simplest thing, but they're not the hardest neither. It's just about wrapping your head around handling the content height changes and how GSAP works. This sample is not very elegant but it's a solid approach to this. I don't know if it's the best approach, but it works: See the Pen ZbGeJd by rhernando (@rhernando) on CodePen The code is quite commented so all the explanation and thought process is there. Hopefully is enough to get you started. Happy Tweening!!! 6 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