views:

105

answers:

2

For some reason, right before my animation of the webkit-transform property occurs, there is a slight flicker. Here is what I am doing:

CSS:

#element {
    -webkit-transition: -webkit-transform 500ms;
}

JavaScript:

$("#element").css("-webkit-transform", "translateX(" + value + "px)");

Right before the transition takes place, there is a flicker. Any idea why this is, and how I could fix the problem?

Thanks!

Update: this only occurs in Safari. It does not happen in Chrome, although the animation does work.

A: 

The solution is mentioned here: http://stackoverflow.com/questions/2946748/iphone-webkit-css-animations-cause-flicker.

For your element, you need to set

-webkit-backface-visibility: hidden;
rpitting
+1  A: 
body {-webkit-transform:translate3d(0,0,0);}
X3Maverick