Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Unable To Apply Scroll Trigger Along With Smooth Scrollbar

Recommended Posts

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 post
Share on other sites


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 QWNoXLM by akapowl (@akapowl) on CodePen



  • Like 4
Link to post
Share on other sites

Thanks alot, You are a great help, I was trying to figure this out since 2 day now. 😃

  • Like 2
Link to post
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.