Jump to content
Search Community

ScrollSmoother change position fixed on wrapper

nfadev test
Moderator Tag

Recommended Posts

Is there a way to not have the SmoothScroller wrapper to be position: fixed? That setting is causing the content to position itself on top of the other content on the page. I'd like to have the SmoothScroll effect without changing the positioning of the content container. 

Link to comment
Share on other sites

Hi @nfadev - can you please provide a minimal demo that clearly illustrates the problem? I bet there's a simpler way to accomplish what you're attempting. 

 

ScrollSmoother's wrapper MUST be position: fixed. It's impossible to get the proper behavior otherwise.

 

Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

 

If you're using something like React/Next/Vue/Nuxt or some other framework, you may find StackBlitz easier to use. We have a series of collections with different templates for you to get started on these different frameworks: React/Next/Vue/Nuxt.

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

Link to comment
Share on other sites

Oh! I think you might be misunderstanding what ScrollSmoother is for. It makes the entire page smooth scroll. 

 

See the Pen poxaLoR?editors=1010 by GreenSock (@GreenSock) on CodePen

 

Are you trying to make just one element smooth-scroll its children or something? Or maybe you're trying to smooth out the height animations in those ScrollTriggered animations? You could just use a numeric scrub in that case: 

See the Pen vYVdRYM?editors=0110 by GreenSock (@GreenSock) 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...