nfadev Posted May 8, 2023 Posted May 8, 2023 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.
GSAP Helper Posted May 8, 2023 Posted May 8, 2023 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.
nfadev Posted May 8, 2023 Author Posted May 8, 2023 Here's a demo illustrating my issue: See the Pen oNaEEPy by shielaNFA (@shielaNFA) on CodePen. It takes over the whole screen, but I need to it stay in its original position
GreenSock Posted May 8, 2023 Posted May 8, 2023 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.
nfadev Posted May 8, 2023 Author Posted May 8, 2023 Oh I see! I didn't realize it was only applied once for the whole page. That makes more sense! Thank you
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now