Jump to content
Search Community

section pin issue

omi test
Moderator Tag

Recommended Posts

I want to make to show the content after the left side and right content move out of the view port on scroll and after that different content  should slide from middle of the blue box. but blue box should be pinned until timeline will get completed.

i don't know why pin is not working.  please do comment if anyone can debug the code.

 

Note: How i can set the dynamic end points so that sliding section will show under the blue box

See the Pen XWqOjBq by omi-bhatia (@omi-bhatia) on CodePen

Link to comment
Share on other sites

 

Yup, @mvaneijgen is right, bootstrap is interfering with ScrollTrigger here.

 

You've got the class position-relative on the element that you are going to pin.

 

What bootstrap's CSS does with that class is this:

 

.position-relative{position:relative!important}

 

The !important in there will interfere with ScrollTrigger, as ST by default will set the element you're pinning to position: fixed inline, but since there is an !important in that CSS rule, this rule will make sure, that the position: relative will never get actually/properly changed - see the problem?

 

Since you set that element to position: relative in your custom CSS anyway, there is no actual need for you to put that bootstrap-class on there, just remove it and you should be better off.

 

Also as a sidenote:

 

You are setting...

 

html {
  scroll-bahavior: smooth
}

 

... which is bound to also interfere with ScrollTrigger ( or other scroll-related plug-ins ), so you might not want to use that.

 

Also, bootstrap will by default set the :root element to that scroll-behavior, so you might want to override that, too. Something like this, maybe:
 

:root {
  scroll-behavior: auto !important;
}

 

 

 

Hope that will help.

 

Scroll (and strap your boots) carefully!

 

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

 

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