HiLuLiT Posted November 14, 2020 Share Posted November 14, 2020 i'm trying to create this demo inside a centered div See the Pen KKpLdWW by GreenSock (@GreenSock) on CodePen I basically wrapped it with a wrapper overflow:hidden div and changed scrollTrigger's pinning to the center of the viewport, but then I completely lost the layered pinning effect... also - I only managed to center the div horizontally with margin: 0 auto, how can I center it vertically? flexbox doesn't seem to work. here's a demo - See the Pen BazMOdL by HiLuLiT (@HiLuLiT) on CodePen Link to comment Share on other sites More sharing options...
HiLuLiT Posted November 15, 2020 Author Share Posted November 15, 2020 I found a solution thanks for this thread and thanks to @akapowl : I updated my demo for the implementation I needed... Thank you too @Hugo Priet My next question would be then - I want to fade in/out the titles on top of each slide- how can I achieve this? 1 Link to comment Share on other sites More sharing options...
ZachSaucier Posted November 16, 2020 Share Posted November 16, 2020 On 11/14/2020 at 7:36 PM, HiLuLiT said: I want to fade in/out the titles on top of each slide- how can I achieve this? Just add those animations to the timeline By the way I highly recommend learning more about the position parameter. In this case the "<" operator is equivalent to what you have. Additionally you could write this code more efficiently by using a loop. I talk more about that in the most common GSAP mistakes and my article about animating efficiently. 1 Link to comment Share on other sites More sharing options...
HiLuLiT Posted November 16, 2020 Author Share Posted November 16, 2020 Thanks for the help @ZachSaucier! I'll defiantly read some more about that and update my demo when done 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