Share Posted April 22, 2022 Hi there. Can I have a scrollable container on a page that has ScrollSmoother initialized? Scrolling inside such containers (that have overflow: auto ) translates to the whole page scroll. Link to comment Share on other sites More sharing options...
Share Posted April 22, 2022 Welcome to the forums @Oleh_Rusyi Can you make a minimal demo showing that? And you are you using normalizeScroll? Link to comment Share on other sites More sharing options...
Author Share Posted April 22, 2022 See the Pen jOYRwaK by rusyioleh (@rusyioleh) on CodePen Link to comment Share on other sites More sharing options...
Share Posted April 22, 2022 Currently normalizeScroll does not support nested scrollers, but it's something we're investigating. For now you'll just have to disable that feature. ScrollSmoother.create({ content: "#smooth-content", wrapper: "#smooth-wrapper", smooth: 1, // how long (in seconds) it takes to "catch up" to the native scroll position effects: false, // looks for data-speed and data-lag attributes on elements // normalizeScroll: true, // prevents address bar from showing/hiding on most devices, solves various other browser inconsistencies smoothTouch: 0, }) 1 Link to comment Share on other sites More sharing options...
Author Share Posted April 26, 2022 Thank you. It's great that we have a smooth scroll feature in gsap, well done 👍 Link to comment Share on other sites More sharing options...
Share Posted March 15 Hi - this is still a bit of a sticking point for us, as the normaliseScroll function is so useful, disabling it because we have a scroller on the page seems to be un-optimal. Is there a different workaround that we could explore? Cheers 1 Link to comment Share on other sites More sharing options...
Share Posted March 15 Sure, @intothebreach - have you tried setting allowNestedScroll: true in your config? ScrollTrigger.normalizeScroll({allowNestedScroll: true}); 1 Link to comment Share on other sites More sharing options...
Share Posted March 15 Thanks Jack! That works nicely, you're a star. Out of interest is this in the docs at all? Couldn't find it myself. Link to comment Share on other sites More sharing options...
Share Posted March 18 Sorry about the confusion there, @intothebreach - it was a "hidden" feature for a while. We were deciding if we should expose it in the API or not, but it has proven itself to be very useful so we're making it official now. It's in the docs. 👍 1 Link to comment Share on other sites More sharing options...
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