Jump to content
Search Community

Smooth animation in Chrome, Firefox, IE, but not Safari

SammyC123 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Is there any explanation for why that Codepen demo scrolls smoothly in Chrome, Firefox, and even Internet Explorer, but in Safari it becomes incomprehensibly jerky, making the screen bounce all around?

 

Even using 

force3D: true

 doesn't seem to make a difference (not that it necessarily should).

See the Pen qZNLKx by anon (@anon) on CodePen

Link to comment
Share on other sites

It has to do with the way Safari repaints ... I've been trying to overcome this too when using ScrollMagic for multiple parallax panels.

 

One trick I've found to work well is to animate to the position being set by scroll rather than just setting the position.

 

Interesting, and thank you for the insight.

 

How does this technique affect other browsers? In other words, is this something I should be doing only when I detect the user is on Safari?

 

Likewise, what sort of animation duration do you recommend to resolve this? Can it be quick (i.e. 0.01 seconds) or does it have to be a custom solution of "this looks the best" for every use case?

 

This kind of reminds me of having to do the old CSS 3D transform trick in order to trigger GPU acceleration.

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