Anael_ Posted October 8, 2021 Share Posted October 8, 2021 Hello there, I use GSAP to animate some "cards", and I will stack them on click. I didn't found a suitable solution, here is my last try with a position: absolute change, but as you see, it's not very linear. Can the Flip plugin help me ? If you have a solution or advice i'll be happy to read it 😀 I am new in the GSAP world and I have a lot to learn. Have a nice day See the Pen abyoopa by anaelr (@anaelr) on CodePen Link to comment Share on other sites More sharing options...
Solution nico fonseca Posted October 8, 2021 Solution Share Posted October 8, 2021 Hi @Anael_, welcome to the forum ! 💚 There are many ways to solve this and I created one for you 🙂. The problem when using position absolute is that you lose the .container dimension (width, height) and if the elements were not positioned with position absolute animation can get weird. So I created this, only animating the transform x, y, calculating the container dimensions and the left position of the element. See the Pen XWareXV?editors=0110 by nicofonseca (@nicofonseca) on CodePen I hope this helps 🙌 6 Link to comment Share on other sites More sharing options...
Anael_ Posted October 8, 2021 Author Share Posted October 8, 2021 Thank you @nico fonseca ! It's perfect, I'll adapt it for vh dimensions Thanks for your help 1 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