Jump to content
Search Community

ScrollTo & scrollTrigger snap bug on mobile

Sacha test
Moderator Tag

Recommended Posts

Hello,

I'm using the snap from scrollTrigger together with scrollTo on my website. Works great on desktop, but I noticed that both don't play along so well on mobile. I've set up the ScrollTo so it scrolls to the top of the page if you click on the logo and you are already on the homepage. Works well, but if you are below the section that uses snap, ScrollTo will not work right and wont scroll to the top like it does normally. It stops at some point or looks really buggy and not smooth.

Here's the website where you can test it on mobile (tested in Safari and Firefox, both having the same bug. But only on mobile devices. Works normal in previews on desktop).

Edit: will write a codePen

Link to comment
Share on other sites

Hi Sacha,

 

We really can't troubleshoot a live site, and I'm not even sure where you are using ScrollTo on that site. Just based on your previous post, the only thing I can think of is that your height calculations might be incorrect. When the address bar moves in and out of view on mobile, it causes a resize as the browsers height has changed. For that, I usually make the address bar always visible like here.

 

 

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