Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Trying to understand ScrollTrigger Pinning/Parallax

Recommended Posts

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

Thank you so much! I was hoping it was something super simple that I was overlooking! 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.