Jump to content
Search Community

How best to disable scrollTrigger when killing body scroll?

iDVB test
Moderator Tag

Recommended Posts

We have a long scroll page with a bunch of animations setup using scrollTrigger. 

We also have modals that we popup and we disable the body scroll when they are up.

 

The issue we are seeing is that when we do this.... scrollTrigger thinks we're back at the top of the page (since scroll height is now 0) and for a split section before the modal comes up... our animation JUMPS back to the top of the page animation and then when you close the modal is JUMPS back to where it should be.

 

Is there a good way we could somehow disable scrollTrigger just before popping up a modal that would not have this type of effect?

 

 

Link to comment
Share on other sites

Right. Ya, I think we are having issues because having a scroll mouse (vs trackpad/magic mouse) causes browsers to show a scrollbar.

And so the result between the two is different. With scrollmouse, disabling scroll is changing the width of the screen as the browser pops in and out the visual scrollbar (inside the flow) which is causing all the animations to recalculate and thus generating all new scrolltriggers. 

 

Let me see about getting a demo/codepen for this. It's a bit of an oddball.

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