icekomo Posted August 4, 2020 Share Posted August 4, 2020 I set up a simple demo that has 3 sections. What I would like is for #section-1 to scroll normal, section-2 to get pinned at the top of the viewport and have #section-3 scroll over #section-2. Sort of a parallax effect, but not pin sections on the page, just the hero image ( section-2 ). Am I setting this up correctly, it seems as though all the demos for parallax have a container set to relative, and all the children ( all sections ) set to absolute, but for my demo I'm only trying to parallax the hero image and the rest of the content would scroll normal. You can see in the demo that section-3 doesn't scroll over top of section-2 it looks as though it falls behind. I think that is due to the fact the the pinning is fixing the element which I know is removing it from the flow of the document. My question would be if there is an easy set up to achieve the effect that I want using ScrollTrigger? See the Pen XWdWdEq by icekomo (@icekomo) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted August 5, 2020 Share Posted August 5, 2020 Hey icekomo. If I'm understanding you correctly you just need position: relative on #section-3. See the Pen jOqOree?editors=0100 by GreenSock (@GreenSock) on CodePen That's what this demo does: See the Pen KKpLdWW by GreenSock (@GreenSock) on CodePen 1 1 Link to comment Share on other sites More sharing options...
icekomo Posted August 5, 2020 Author Share Posted August 5, 2020 Thank you so much! I was hoping it was something super simple that I was overlooking! 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