Jump to content
GreenSock

vladdesign

ScrollSmoother paused - scroll modal content?

Recommended Posts

Hi guys, i have a situation where a have to open modal on website and to pause smooth scroll when modal is open, but when i pause it nothing can be scrolled? do i have to use scrolltrigger then, or is there some workaround? thanks in advance, cheers!

See the Pen MWQwbGq by Djarmito (@Djarmito) on CodePen

Link to comment
Share on other sites

The problem is that you set the height to 100vh (good) and overflow: visible (BAD), meaning there's no way to scroll to the rest of the content. It's totally unrelated to anything with GreenSock tools - it's your CSS. 

 

I assume you meant something more like this?: 

See the Pen gOvpXdK?editors=0010 by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Ok, so it didn't solve my problem, i saw that i have also normalizeScroll enabled on my project, and when it's enabled i'm unable to scroll when modal is open. I tried to make a demo with normalize, i'm not sure should i register it on codepen with gsap (include it in gsap.registerPlugin, cuz i add it it trows an error)? but when it's enabled on codepan it works same as your demo, i'm not sure if it's enabled or i'm doing something wrong

Link to comment
Share on other sites

I'm a little unsure about what you're asking. It seems to work fine with normalizeScroll enabled.

 

See the Pen MWQarZb by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Ok, i'm a little bit confused right now, i have managed to solve my problem without pausing scroll smoother when modal is opened. i just added hidden class to html tag and it works now (it wont scroll while modal is open in background). But still when i try to do it with scrollsmoother.paused() i'm unable to scroll when modal is opened as shown on video.

 

Update: 

it works if normalize is off, but when enabled doesn't work, works only on keys up and down 🤯

 

 

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