我如何让这两个一起工作?看起来他们正在阻止/打破彼此/或仅调用损坏的transform3d
HTML结构
<div id="container">
<div class="one" style="transform:translate3d(0,0,0)"></div>
<div class="two"></div>
<div class="one" style="transform:translate3d(0,200px,0)"></div>
<div class="two"></div>
<div class="one" style="transform:translate3d(100px,100px,0)"></div>
<div class="two"></div>
</div>
<div class="div one"></div>
CSS样式
#container {
-webkit-perspective:200px;
-webkit-transform-style:preserve-3d;
width:450px
}
.one {
position:absolute;
width:100px;
height:100px;
background-color:blue;
-webkit-transition:1s ease all;
border:1px solid black;
}
.two {
-webkit-transform:translate3d(0, 100px, 0);
position:absolute;
width:100px;
height:100px;
background-color:red;
-webkit-transition:1s ease all;
border:1px solid black
}
.one:hover {
-webkit-transform:scale3d(0, 0, 0);
}
.div.one {
width:100px;
height:100px;
background-color:green;
-webkit-transform:translate3d(0,400px,0);
}
.div.one:hover{
-webkit-transform:scale3d(0,0,0);
}
答案 0 :(得分:5)
使用多个变换时,您应该将其合并为一个,如下所示:
transform: translate3d(0,400px,0) scale3d(0,0,0);
否则它会覆盖/阻止,如你所说。