jenda Posted April 9 Posted April 9 Hello, I would like to show and hide absolute positioned texts step by step by scrolling. First, I calculated the height of all text elements to use it for the End setting in ScrollTrigger. But I can see that the animations don't work correctly. On my website where I have the code more complex, it occurs an overlapping effect. What shall I improve? See the Pen RNwmEEd by jankout (@jankout) on CodePen.
Solution Rodrigo Posted April 9 Solution Posted April 9 Hi, Maybe something like this: See the Pen dPyByvX by GreenSock (@GreenSock) on CodePen. Here is a variation that shows and hides the texts simultaneously: See the Pen mydZdWm by GreenSock (@GreenSock) on CodePen. Hopefully this helps Happy Tweening! 1
jenda Posted April 15 Author Posted April 15 Thats perfect. Thank you very much. How can I achieve to animate the headlines at the same time as the paragraphs.
Rodrigo Posted April 15 Posted April 15 Hi, I updated the demo: See the Pen dPyByvX by GreenSock (@GreenSock) on CodePen. Is just about using an array for the first animation (since the final value of both elements is the same on the same properties (opacity and Y) and then use the position parameter in order to make the exit animations happen at the same time. https://gsap.com/docs/v3/GSAP/Timeline#positioning-animations-in-a-timeline Hopefully this helps Happy Tweening!
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