Update
Sorry for failing to add the minor detail that we also layer a lot of div
elements on top of each other with z-index
.
After working more with this problem, it seems that the webkit-transform
actually messes with the z-index
ordering, and that the actual problem is not related to the animations themselves.
End update
I am currently in a project where we develop an application which is quite heavy on CSS3 animations. We're animating a lot of div
elements around with -webkit-transform
and -webkit-transition
.
All is well, until today where all of the to-be-animated elements of the page disappeared. It seems that Google Chrome has updated from 12.xx to 13.0.782.107m and now, all of a sudden, CSS3 properties with -webkit
prefixes has stopped working, and elements which have this property applied to them just doesn't show anymore. Removing the -webkit-transform
property through the Chrome debugger makes the elements visible again.
Has anyone else experienced the same issues, or know how to solve this problem?
I might add that I've tried to remove just the -webkit
prefixes (leaving just transform
), which then shows the missing elements, but then that won't animate the elements at all, as the CSS3 property transform
is not supported.
I have also tried using el.style.webkitTransform
and el.style.WebkitTransform
, with no success.
Will pass some example code to explain. The desired result of this is to move sq1
away and reveal sq2
.
HTML:
<div id="sq1" style="z-index:10;">
<div id="sq2" style="z-index:5;">
JS
/* fetch the element */
var el = document.getElementById("sq1");
/* apply CSS */
el.style["-webkit-transition"] = "-webkit-transform 500ms linear";
el.style["-webkit-transform"] = "translate3d(30px, 30px, 0px)";
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…