Jump to content
GreenSock

Mukhriddin

why animation with scrollTrigger don't work on mobile?

Recommended Posts

Hi, I have done some scrollTrigger stuff with my project. And it's pretty cool working desktop resolution (like 1440x908px) and mobile resolution (375x812px) while scrolling on my computer. But when I visit this project via my own mobile phone (iPhone 12pro) with localhost, transitions, transforms, etc. don't work perfectly, sometimes works sometimes not. What'd be the reason of that? 
Thanks!

Link to comment
Share on other sites

It's pretty tough to troubleshoot without a minimal demo - the issue could be caused by CSS, markup, a third party library, your browser, an external script that's totally unrelated to GSAP, etc. Would you please provide a very simple CodePen or CodeSandbox that demonstrates the issue? 

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best (avoid frameworks if possible). See if you can recreate the issue with as few dependancies as possible. If not, incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, then at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

 

Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

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

 

If you're using something like React/Next/Nuxt/Gatsby or some other framework, you may find CodeSandbox easier to use. 

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

Link to comment
Share on other sites

22 hours ago, GSAP Helper said:

It's pretty tough to troubleshoot without a minimal demo - the issue could be caused by CSS, markup, a third party library, your browser, an external script that's totally unrelated to GSAP, etc. Would you please provide a very simple CodePen or CodeSandbox that demonstrates the issue? 

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best (avoid frameworks if possible). See if you can recreate the issue with as few dependancies as possible. If not, incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, then at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

 

Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

 

 

If you're using something like React/Next/Nuxt/Gatsby or some other framework, you may find CodeSandbox easier to use. 

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

The project is quite big, I can't create minimized demo. In fact, I came to know, scroll animations are working slow and jerky on android, and they are sometimes working, sometimes not  on IOS)

Link to comment
Share on other sites

That is why you create a minimal demo. You do it as much for us to help you debug as for your self to figure out where you made a mistake.

 

I myself always make demos for my project, just quick iterations of small functions of the site, to test out theories or different ways of constructing something.

 

Codepen is Great for that, because you can easily fork your work and quickly see what works or not. Doing it on the live site can work, but the problem with that is you can't easily  share it with others.

 

Again just post a minimal demo of just some colored div's shouldn't take you much time or feel free to post over at Jobs and freelance forum

  • Like 2
Link to comment
Share on other sites

Also - it's worth mentioning that 'janky' animations are down to a lot of different factors.

Maybe you're animating too many things, maybe you're animating properties that aren't performant, maybe you're executing a ton of JS in the background, maybe it's a browser bug, maybe it's a browser extension, maybe it's your internet connection.

So many different things could be causing it. The only way to debug is by making a demo. Take the jankiest animation, seperate it out by itself and then test, if it's ok, add more, then test, etc.

We don't have any magic tips here unfortunately! We use the same debugging steps as everyone else.

  • Like 2
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.
×