ToxifiedM Posted September 27, 2020 Share Posted September 27, 2020 Whenever I try to use the scroll trigger using scroll proxy for the "smooth-scrollbar", it only works when I initiate the scroll to the body, when I am doing it for the tag, <main class="root">, the smooth scrollbar works but the scroll trigger doesn't. To make the scroll trigger work, I have to first initialize the smooth scrollbar to the body along with the scroll proxy. As in here, I need to attach the scroll bar to the class ".root" and need to make scroll trigger work for the same, instead of attaching the whole thing to the "body". I am not just getting what's up. Please revert back. See the Pen zYqbJyZ by ToxifiedM (@ToxifiedM) on CodePen Link to comment Share on other sites More sharing options...
akapowl Posted September 27, 2020 Share Posted September 27, 2020 Hey @ToxifiedM - welcome to the forums. In your case, ScrollTrigger is not working, because you also have to define ".root" as its scroller. ... scrollTrigger: { scrub: true, scroller: ".root" } ... See the Pen 970c722b72c587c052dba20a5f5d3467 by akapowl (@akapowl) on CodePen 4 Link to comment Share on other sites More sharing options...
ToxifiedM Posted September 27, 2020 Author Share Posted September 27, 2020 Thanks alot, You are a great help, I was trying to figure this out since 2 day now. 😃 2 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