Jump to content
Search Community

how to make scroll trigger work on mobile phones

alirezahekmati test
Moderator Tag

Recommended Posts

Hello @alirezahekmati

 

It does work on mobile for me, but depending on the size of your screen the car might already have reached his endX and that's why you don't see it move. I adjusted the pen a bit, so now it runs from the left side off screen to the right side off screen, so now you should see it working, no matter how big the screen is.

 

let startX = gsap.getProperty('svg', 'width') * -1
let endX = width

...

...
.fromTo("svg", {x:startX}, {duration:duration, x:endX, ease:ease})
...

 

See the Pen bf350d6a1ddce94d54392d1f09a9c69b by akapowl (@akapowl) on CodePen

 

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