Jump to content
Search Community

ScrollTrigger | Bottom-aligned pinned column

Alessandro Newzoo test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

Hello guys, thank you so much for GSAP, it's been my go-to tool for years now and couldn't live without!

 

I'm trying to have the green column to stick during the whole height of the blue column, and it's almost all how I wanted it, except for the fact that end: bottom bottom doesn't actually match the bottom of the pinned element, but it stops way before reaching the end of the green column, leaving quite a lot of white space.

 

Unless I'm mistaken, the docs describe bottom bottom as 

Quote

when the bottom of the trigger hits the bottom of the endTrigger

 

so this is what I'd expect:

 

image.thumb.png.56b82ae117c29e47e3185f1a44e89ed1.png

Please, what am I doing wrong?


Thanks!

See the Pen oNomRBp by solidpixel (@solidpixel) on CodePen

Link to comment
Share on other sites

  • Solution

Hello Alessandro - welcome to the GreenSock forums.

 

The first parameter of start/end stands for the trigger/endtrigger element, the second stands for the window/viewport.

 

So with the '.right' as the endTrigger and an end of 'bottom bottom' that would mean: "unpin when the bottom of .right hits the bottom of the window" - which it does.

 

If you want the bottoms of both elements to align when unpinning, you would have to calculate things a bit.

 

Something like these two different examples show:

 

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

 

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

 

  • Like 4
  • Thanks 1
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...