Jump to content
Search Community

Scrolling quickly down the page on mobile resets the pinned elements

amacondray test
Moderator Tag

Recommended Posts

It's very likely because the mobile browser is changing the window size by showing/hiding the address bar which triggers a ScrollTrigger.refresh() (when the scrolling is done so as to avoid interrupting the momentum scrolling). You can skip that by changing the autoRefreshEvents list in .config() (remove resize) but of course that means you risk the start/end values for all you ScrollTriggers being incorrect. In other words, there's a fundamental logic issue at play here - if your window resizes that likely changes the size of other elements and the position of the scrollbar where things should be triggered, thus ScrollTrigger.refresh() must do its work to recalculate things. 

 

There's a hint in the helper functions to prevent the window from resizing (though that's a tradeoff UX-wise of course): https://greensock.com/docs/v3/HelperFunctions#scrollResize

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