Search the Community
Showing results for tags 'scroll-behavior'.
-
I have noticed that ScrollTrigger briefly switches the scroll-behavior property of my scroller (the html element) from smooth to auto and back as it toggles between isActive states. Is this known/intentional behavior? In my case, it breaks the functionality of a native "back to top" button on the same page because the automated scroll is halted shortly after crossing the isActive threshold. I assumed using GSAPs own ScrollToPlugin would do the trick here but that didn’t help either. Neither did using zenscroll with window.noZensmooth set to true. Any help would be much appreciated. Here is my code. I commented out the code I execute on toggle as it makes no difference to the behavior described above. gsap.to(overlay[0], { scrollTrigger: { trigger: footer[0], start: "top bottom", end: "bottom top", scrub: 1, onToggle: (self) => { if (self.isActive) { // main.addClass("fixed bottom left right"); // spacer.removeClass("hidden"); // overlay.removeClass("hidden"); } else { // main.removeClass("fixed bottom left right"); // spacer.addClass("hidden"); // overlay.addClass("hidden"); } }, }, opacity: 1, });
- 3 replies
-
- scrolltrigger
- scroll-behavior
-
(and 2 more)
Tagged with:
-
As you can see from the demo url, when you scroll down, and click on the "up arrow" on the bottom right corner, scroll to plugin fails to scroll on Firefox. However if you disable the "scroll-behavior: smooth;" css on body element, the scroll works perfectly. http://goodlife.fuelthemes.net/