我有一個<span>
,裏面有一些文字,當你將鼠標懸停在它上面時,圖像就會滑到頁面上。到現在爲止還挺好。但是,當鼠標意外懸停在圖像上時,動畫將停止。我不要那個。CSS懸停停止動畫
.coffee {
-webkit-transition: color 0.2s linear;
-moz-transition: color 0.2s linear;
-o-transition: color 0.2s linear;
-ms-transition: color 0.2s linear;
transition: color 0.2s linear;
z-index: 10;
}
.coffee:hover {
color: #B88A00;
}
.coffee img {
position: absolute;
display: block;
height: 100px;
width: 100px;
z-index: 1;
left: 280px;
top: 50px;
opacity: 0;
-webkit-transition: top 0.4s ease-in-out, opacity 0.6s ease-in-out;
-moz-transition: top 0.4s ease-in-out, opacity 0.6s ease-in-out;
-o-transition: top 0.4s ease-in-out, opacity 0.6s ease-in-out;
-ms-transition: top 0.4s ease-in-out, opacity 0.6s ease-in-out;
transition: top 0.4s ease-in-out, opacity 0.6s ease-in-out;
}
.coffee:hover img {
top: 150px;
opacity: 1;
}
任何幫助將不勝感激。
你可以創建http://jsfiddle.net一個例子更好地理解 – sandeep
我已經創建了我的第一個例子的jsfiddle; http://jsfiddle.net/quLKb/ – Ziggy