Jump to content
Search Community

Stop scrolling in a certain section of my page using GSAP ScrollTrigger

moody test
Moderator Tag

Recommended Posts

I’m trying to stop scrolling in a certain section of my page using GSAP ScrollTrigger. Specifically, I have a GTLF model that I want to display in a section called “section-four” and I need to disable scrolling while the model is visible.

I’ve tried using endTrigger but it didn’t work. Can you suggest the best way to achieve this using GSAP ScrollTrigger? I’m sharing an example of my code below:

See the Pen qBJdprL by MOODYWAA (@MOODYWAA) on CodePen

Link to comment
Share on other sites

Hi,

 

What you can do is use the Observer Plugin in order to prevent ScrollTrigger to keep moving and somehow "lock" the scroll. In this thread it was discussed how that could be achieved:

 

Here you can check the docs for the Observer Plugin:

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

 

Hopefully this is enough to get you started. Let us know if you have more questions.

Happy Tweening!

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...