Jump to content
Search Community

"Smooth scrolling" on entire page with pinned elements.

existentialdread test
Moderator Tag

Recommended Posts

@Eric Dyken first off, thanks for being a Club GreenSock member. We really couldn't do what we do without supporters like you. 🙌

 

Like I said, as far as we know, pinning works great with ScrollSmoother but if you ran into an edge case where it doesn't, we definitely want to solve that. If you could provide us a minimal demo, even if you don't want help for yourself it could end up helping many other people who may find themselves in a similar position down the road. 

 

I'm super bummed to hear about your disappointment and frustration. I know what it's like to try so hard to make something work and then get utterly frustrated when there seems to be no viable solution. 🤕

Link to comment
Share on other sites

@Cassie 

 

Cassie, I'd like to extend my gratitude to you and Jack.  After creating a demo which I was really reluctant to do it became obvious that the problem was on my end (after seeing

See the Pen vYdVgOY by edyken77 (@edyken77) on CodePen

work with no issues).

My problem was I was running the ScrollSmoother.create constructor  in a main.js file:

function smoov() {
    const smoother = ScrollSmoother.create({
        wrapper: '#smooth-wrapper',
        content: '#smooth-content',
        smooth: 2,
        effects: true,
    });

    return smoother;
}
smoov();

whilst my scrolltrigger for the pinning was in a different .js file.  The separate js did not have scrollsmoother imported so that was my issue.  I just assumed if it was in the main.js it would be fine but that was not the case (and since the scrolling of the actual page still had the smoothing it seemed like it was global).    No console errors were thrown, although I did not check the console warnings so that may have saved me some headaches.

I also did not notice that OP was using the scrollTo and not the smoothscroll plugin so this is probably not even the right thread!  My Apologies.  Noobie learning a lot today!

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