Jump to content
Search Community

ScrollTrigger cause subsequent element overlap/cover previous one once unpinned

nickraps test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

I use ScrollTrigger to pin an element:

 const trigger = ScrollTrigger.create({
      trigger: q('#map-pin-trigger'),
      start: '-=48px top',
      end: 'bottom center',
      pin: q('#map-container'),
      // markers: true,
 })

 

However, once I scroll to the end of the trigger & it unpins, the subsequent element would be covered up by the previous unpinned item (it goes under the previous item), it looks like this (part in red square shouldn't cover up the chart):

26962739_ScreenShot2022-01-24at16_32_59.thumb.png.6b8960424589c5f3d4b154dc45ba01d3.png

 

I added a CodePen demo.

 

Any advices would be appreciated. Thanks. I feel it has something to do with pinSpacing but I couldn't make it work. 

 

If you could help me understand why this could happen that'll be great too!

 

 

See the Pen YzEXVzW by noahsong (@noahsong) on CodePen

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