samwatts1988 Posted June 18, 2023 Share Posted June 18, 2023 Hi there! I'm currently working on a project which is using ScrollSmoother and ScrollTrigger, which involves the use of modals popping up over the top of the content. I just wondered what the most effective method of freezing/locking the scroll position is when a modal is opened over the top of the content? I've looked at .kill() and .paused() and these prevent the sequence from running but don't appear to "lock" the scroll. Similarly, I've looked at attaching a CSS class which puts overflow: hidden; on the HTML and body elements, however this doesn't succeed either (presumably because GSAP is still running transform: matrix3d(); on the scrollable element. Entirely possible I've misinterpreted something in the docs so apologies in advance if there's an obvious candidate I've overlooked, but any help/pointers here would be hugely appreciated. Many thanks! Sam Link to comment Share on other sites More sharing options...
Solution GreenSock Posted June 19, 2023 Solution Share Posted June 19, 2023 13 hours ago, samwatts1988 said: I've looked at .kill() and .paused() and these prevent the sequence from running but don't appear to "lock" the scroll. Wait, are you saying that you tried calling smoother.paused(true) and it didn't prevent the scroll? It certainly should. If not, please provide a minimal demo and we'll take a peek. https://greensock.com/docs/v3/Plugins/ScrollSmoother/paused() 1 Link to comment Share on other sites More sharing options...
samwatts1988 Posted June 19, 2023 Author Share Posted June 19, 2023 Ah! Got it. I was trying to set .paused() on the timeline instead of the smoother. Thanks so much for the pointer! Link to comment Share on other sites More sharing options...
GreenSock Posted June 19, 2023 Share Posted June 19, 2023 No problem at all! Glad it worked out. Enjoy! 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