Jump to content
Search Community

ScrollTrigger - item doesn't keep pinned

Michaël Garcia

Go to solution Solved by mikel,

Recommended Posts

Michaël Garcia
Posted

Hello,

I'd like to reproduce a css sticky behavior. 

Unfortunately as you can see on my codePen, it doesn't keep pinned until the end of my section despite the end attribute.

 

Does anyone see what I'm missing ?

Thanks a lot

See the Pen bGBEdRZ by michaelgrc (@michaelgrc) on CodePen.

elegantseagulls
Posted

Hi @Michael31,

For your particular markup, you're missing:

pinSpacing: false,

  • Like 4
Michaël Garcia
Posted

Hey @elegantseagulls,

thanks for your answer. So I added this attribute but it seems to add a new issue on both my codePen (you can see it right above) and my project.

It adds an extra height at the end of my page. When I inspect it, it seems to be the section set inside the trigger attribute. 

 

Do I miss something ? Thanks a lot

  • Solution
Posted

Hey @Michael31,

 

You trigger the section trigger: '.pinSection' and you should pin the element pin: '.pinElmt'

 

See the Pen QWGyQKo by mikeK (@mikeK) on CodePen.

 

Happy pinning ...

Mikel

  • Like 4
Michaël Garcia
Posted

Hey @mikel,

This last tip did the trick ! 

 

Thanks a lot for your time.

  • Like 2

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...