Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone WebKit CSS animations cause flicker

This is the iphone site: http://www.thevisionairegroup.com/projects/accessorizer/site/

After you click "play now" you'll get to a game. The guns will scroll in. You can scroll the purse and accessories up and down. You can see that when you let go they snap into place. Just as that snap happens, there's a flicker that occurs. The only webkit animations I'm using are:

'-webkit-transition': 'none'  '-webkit-transition': 'all 0.2s ease-out'  '-webkit-transform': 'translate(XXpx, XXpx)' 

I choose either the first or second transition based on whether or not I want it to animate, and the transform is the only way I move things around.

The biggest issue though is when you click "Match items", then click "Play again". You'll see as the guns animate in, the entire background of the accessories/purses goes white. Can someone please radiate me with some insight asto why this is happening??

like image 250
Jake Chapa Avatar asked Jun 01 '10 01:06

Jake Chapa


People also ask

Does CSS animations affect performance?

TL;DR # Take care that your animations don't cause performance issues; ensure that you know the impact of animating a given CSS property. Animating properties that change the geometry of the page (layout) or cause painting are particularly expensive. Where you can, stick to changing transforms and opacity.

Do you need WebKit for animation?

WebKit-based browsers (including Opera 15 and later) still require the -webkit- prefix for animations today, and transforms are only unprefixed in recent versions of Chrome. You will need the prefix for both features.

What is CSS WebKit animation?

The CSS -webkit-animation property is a shorthand property for setting WebKit multiple animation properties in one place. To create an animation using WebKit, use the -webkit-animation in conjunction with the @-webkit-keyframes keyword/at-rule, which allows you to define visual effects for your animation.


2 Answers

Try this, and hopefully it will help:

#game {   -webkit-backface-visibility: hidden; } 
like image 33
donohoe Avatar answered Sep 20 '22 15:09

donohoe


I added -webkit-backface-visiblity and that mostly helped, but I still had an initial flicker after reloading the page. When I added -webkit-perspective: 1000, there was no flicker whatsoever.

-webkit-perspective: 1000; -webkit-backface-visibility: hidden; 
like image 89
Wes Baker Avatar answered Sep 18 '22 15:09

Wes Baker