Makssshow Posted June 9, 2021 Share Posted June 9, 2021 Hi there! On mobile safari autoscrolling to the sections is lagging. Can you help me to fix it? See the Pen dyvqbOX by makssshow (@makssshow) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted June 9, 2021 Share Posted June 9, 2021 I don't see anything unexpected, @Makssshow. Can you elaborate? I looked on my iPhone and iPad. Is this a GSAP question or are you asking for general performance audit help? We really try to keep these forums focused on GSAP-specific questions since we don't have the resources to provide free general consulting. Link to comment Share on other sites More sharing options...
Makssshow Posted June 10, 2021 Author Share Posted June 10, 2021 Hello! Here is a video from the iphone 8+. I made little swipes and autoscroll as if to be afraid of scrolling) Link to comment Share on other sites More sharing options...
Makssshow Posted June 10, 2021 Author Share Posted June 10, 2021 Also on the whole page. here you can see the problem better Link to comment Share on other sites More sharing options...
Cassie Posted June 10, 2021 Share Posted June 10, 2021 I'm afraid we don't have the capacity to do performance audits, but a few points. The first video you linked to was scrolling in codepen - this isn't going to be an accurate representation as it's in an iframe and codepen does all sorts of jazz, so it's hard to debug in that set up. You're animating layout properties, top, left, bottom etc. This is very bad for performance and will cause jerky repaints and layout reflows. You're animating transforms too, but like this for some reason - transform: "translateY(0%)" - no need! You can just say y: 0 Link to comment Share on other sites More sharing options...
GreenSock Posted June 10, 2021 Share Posted June 10, 2021 Also, just to be clear, it's completely normal for there to be a gap in time between when you take your finger off the screen and when the snapping occurs. ScrollTrigger must wait until "scroll" events stop being dispatched for a certain amount of time before considering the scroll "ended", otherwise it might interrupt scrolling and jump into action too soon, especially on desktop devices that can be scrolled in many ways (mouse wheel, touchpad, dragging the scrollbar, tapping the down/up arrow or space bar, etc.) Link to comment Share on other sites More sharing options...
Makssshow Posted June 10, 2021 Author Share Posted June 10, 2021 I understand it. The problem happens while scrolltrigger moving to the center of section, not because scroll event doesn't stop Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now