Jump to content
Search Community

Page has issues on IOS devices because of bottom toolbar

kwastaras test
Moderator Tag

Recommended Posts

  • kwastaras changed the title to Page has issues on IOS devices because of bottom toolbar

ScrollTrigger will automatically .refresh() whenever the viewport resizes so that the start/end positions get recalculated. When the address bar shows/hides, that changes the viewport size. If you want ScrollTrigger to ignore those resizes from the address bar, you can do this: 

ScrollTrigger.config({ ignoreMobileResize: true });

Does that help? 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I'm a bit confused - if you refresh() at a different height, then of course the start/end values will get recalculated and it could cause a jump which is exactly what ignoreMobileResize is avoiding. It kinda sounds like you're asking "how do I skip the refresh...and also do the refresh?" 

 

You'll definitely have a much better chance of getting a good answer if you provide a minimal demo. Don't include your project - just the simplest possible demo you can create (a CodePen, Stackblitz, or CodeSandbox). 

  • Like 1
Link to comment
Share on other sites

@GreenSock sorry for that, I understood now that I wanted to do literally the same. I've edited my message. Just on load, when bottom toolbar is visible, the window.innerHeight is smaller and initial scrollTriggers are calculated based on that smaller height, and I want to somehow calculate them as if toolbar is already hidden ( highest possible innerHeight on load)

Link to comment
Share on other sites

ScrollTrigger measures things according to the actual layout, not a fictitious value. So in order to do what you're asking, you'd need to make your page layout render as if there's no address bar which entails setting up your CSS accordingly. I think there's some kind of new viewport unit that may give you to maximum viewport height available (excludes address bar), but I don't have time to research that for you. 

 

Either that or you'd have to find a way in JavaScript to force the address bar to hide so that you can then do a .refresh() at that point, and then restore the address bar after setting ignoreMobileResize: true. I kinda doubt that's possible. 

  • Like 1
  • Thanks 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...