Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix flicker when using Webkit transforms & transitions in iOS 6

Tags:

css

ios6

ipad

We've built an HTML5 app for the ipad that uses Webkit transforms and transitions for animations. In the past we have had to use -webkit-transform: translate3d(0,0,0); to enable hardware acceleration to prevent animations from flickering and to appear smooth. We have updated to iOS 6 and this technique no longer seems to work. Is there a new way to invoke hardware accelation in iOS 6 for animations?

like image 432
user1491646 Avatar asked Sep 21 '12 10:09

user1491646


People also ask

How to stop CSS animation flicker in webkit?

Fortunately, several options are available to fix that : -webkit-backface-visibility: hidden; This CSS rule is designed to fix the flicker effect on Chrome-based browsers, applied to the HTML flickering element. But use it wisely : this rule works, but is not the most efficient way to avoid flickering effect.

How do I stop Javascript from flickering?

By adding <script>document. documentElement. className += 'js';</script> to the head, you basically get the benefits of hiding unstyled content before DOM ready, and also it doesn't mess up for those without Javascript. Save this answer.

How do I stop angular flickering?

The ngCloak directive is used to prevent the AngularJS html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display.

What is the use of Webkit transition?

The -webkit-transition Boolean non-standardCSS media feature is a WebKit extension whose value is true if the browsing context supports CSS transitions. Apple has a description in Safari CSS Reference; this is now called transition there.


2 Answers

Try this:

-webkit-perspective: 1000;
-webkit-backface-visibility: hidden;
like image 51
Ken Frazier Avatar answered Sep 28 '22 07:09

Ken Frazier


Apple has changed safari in iOS6, so that using translate3d doesn't automatically trigger GPU acceleration. I think people are playing with different approaches right now to figure out how to make this happen.

like image 39
Michael Mullany Avatar answered Sep 28 '22 06:09

Michael Mullany