Kri*_*iem 0 css transform css3 translate3d
我实现了这个代码段:
CSS
div
{
position:absolute;
-webkit-transition: all 0.3s ease-out;
}
.block
{
background:#fc0; /* YELLOW */
top:50px;
left:50px;
width:80px;
height:40px;
-webkit-transform: rotate3d(1,0,0,-55deg) rotate3d(0,0,1,30deg);
}
.block .part
{
background:#444; /* GREY */
width:inherit;
height:inherit;
-webkit-transform: translate3d(0,0,50px);
}
.block:hover .part
{
-webkit-transform: translate3d(10px,10px,20px); /* ONLY TRANSFORMS X & Y */
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="block">
<div class="part"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
查看这个小提琴的实时示例.
正如你所看到的,在翻译:hover只影响.part在x轴和y轴.
它不会在z方向上平移.
谁知道我做错了什么?
| 归档时间: |
|
| 查看次数: |
4301 次 |
| 最近记录: |