Jump to content
Search Community

Remove Scroll Trigger pin on reverse?

Wilson1077 test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

I've been working on an idea similar to the one in this codepen and I have been wondering what is the best way to remove the pin animations from recurring on reverse (scrolling back up)? So ideally, I would like for the text to remain visible and the coloured images to stay in place while scrolling back up the page.

 

I understand the use of tl.kil(true) inside of an OnLeave() event (or maybe I don't) however I still have to remove the extra padding/spacing created by the pins as well as on the parent container that gets generated which means I also have to reposition the block to the top of the viewport (scrolljacking) which devs always try to avoid. Also, I am including ScrollTrigger.refresh()  to re-calculate the starting positions of other blocks of the same type on the same page.

 

Thanks for this insanely good product, I always enjoy browsing the forum for ideas.

See the Pen wvporZr by Wilson1077 (@Wilson1077) on CodePen

Link to comment
Share on other sites

  • Solution

Hello @Wilson1077

 

Have a look at the different threads linked in this one here, they show how to do that (I think that first one linked there is with React, the others are vanilla JS). I hope those will help. Happy scrolling!

 

 

 

 

Edit

Here is your example with @OSUBlake's suggestion from the first linked thread in there implemented

 

See the Pen XWVNZNB by akapowl (@akapowl) on CodePen

 

  • Like 2
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.
×
×
  • Create New...