我有一個簡單的按鈕,它有懸停時的3d轉換。在Chrome中懸停狀態檢測CSS 3D元素
它在Firefox中很好地工作,但在Chrome中,「懸停區域」小於按鈕。如果按鈕不能即時播放動畫,則感覺不一致並且非常糟糕。
的HTML:
<div id="page-wrap">
<div class="link1">CONTACT</div>
</div>
的CSS也相當簡單,但前綴,包括一些解決方法已經:
.link1 {
font-family: sans-serif;
position: relative;
font-size: 30px;
color: #fff;
cursor: pointer;
width: 230px;
height: 95px;
line-height: 95px;
background-color: rgba(20,20,20,0.9);
display: inline-block;
margin: 80px 90px;
font-weight: 200;
text-align: center;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
-moz-transform: perspective(1000px);
-ms-transform: perspective(1000px);
-o-transform: perspective(1000px);
-webkit-transform: perspective(1000px);
transform: perspective(1000px);
transform-style: preserve-3d;
outline: 1px solid transparent; /* Workaround Firefox Anti Aliasing */
}
.link1:hover {
-moz-transform: perspective(1000px) rotateY(30deg) translateX(25px);
-ms-transform: perspective(1000px) rotateY(30deg) translateX(25px);
-o-transform: perspective(1000px) rotateY(30deg) translateX(25px);
-webkit-transform: perspective(1000px) rotateY(30deg) translateX(25px);
transform: perspective(1000px) rotateY(30deg) translateX(25px);
}
我會,如果很開心有人可以幫忙!
謝謝!它現在肯定有效(當然,當按鈕跳進你的臉時),你能告訴我一個轉換起源的jfiddle嗎? (你發佈的鏈接沒有被編輯,它是原來的) – JKunstwald
這裏是更新的小提琴也使用變換比例來對付translateZ http://jsfiddle.net/ZsXkY/2/。在變換原點上工作... – CodeToad
這裏是變換原點的一個無關例子。它並不總是很容易看到在所有情況下的差異,os我在這裏使用了rotateZ:http://jsfiddle.net/q5G4c/2/ – CodeToad