Jump to content
Search Community

Scroll Trigger does not seem to work on elements with hidden overflow

Charlène Bonnardeaux test
Moderator Tag

Recommended Posts

 

Hello Charlène,

 

since you are setting the overflow to hidden on the body, you are basically disabling any scroll - but ScrollTrigger, as the name says, is built to work with scroll. Also you do have a height of 100vh and overflow: hidden on that viewer ref which basically makes this container unscrollable too, so it doesn't really make sense to use it as the scroller, I think.

 

If you want to use ScrollTrigger you will have to make sure to have some scrollable space to begin with - and if all you wanted to achieve by setting the overflow to hidden on the body, was to make sure there are no scrollbars visible, have a look at this post, it might help with that.
 

 

See the Pen GRxKGzK by akapowl (@akapowl) on CodePen

 

 

 

Maybe I'm just not seeing the bigger picture here, though, and actually the overflow: hidden is exactly what you want, because you want to do some sort of scroll-jacking - but then you might have to listen to the different available events related to scrolling, like mousewheel, touch etc. instead, because there won't be native scrolling available, which ScrollTrigger needs for it to work.

 

In that case, the Observer Plugin might be what you'd want to have a look at.

 

https://greensock.com/docs/v3/Plugins/Observer

 

But again, I'm not sure I really understand what exactly you are going for. Nonetheless, I hope this helps a bit.

 

And thank you for supporting GreenSock by being a club member!

 

  • Like 1
Link to comment
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.
×
×
  • Create New...