Jump to content

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

Question about pinning and scrolltrigger

Recommended Posts

Hi Everyone, 


Having a small issue with using the pin property in scrolltrigger. I have a multi layer svg inside of a single div. When you scroll down different layers of the svg should appear and other layers should hide. I was able to accomplish this (with the help from this amazing forum) using css (position: fixed) but I'd like to see if this is possible using the pin property instead. As you can see from my pen when I scroll down all the layers appear. The scrolling svg should stop at the top of the second container div. 


Should I be using pin this way or should I separate the svg layers I have into separate svgs and add each in to separate divs so I can get pin to work?



See the Pen eYzMEVM?editors=0010 by phernand42 (@phernand42) on CodePen

Link to post
Share on other sites

Hey @phernand42,


@ZachSaucier already gave a hint here



But you can also just use one scrollTrigger that pin the IMAGE.
You can then easily show and hide elements using stagger functions.


See the Pen wvWjMyM by mikeK (@mikeK) on CodePen


Happy scrolling ...



  • Like 3
  • Thanks 1
Link to post
Share on other sites

Thanks for pointing me in the right direction @mikel!


Still getting the hang of this but I love it so far. Learned a lot from you all. 

Link to post
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.