所以我正在玩轉換/懸停效果,所以這就是代碼。CSS3懸停轉換奇怪的行爲
HTML
<section>
<a href="#" title="button">CLICK!</a>
<a href="#" title="button">CLICK!</a>
<a href="#" title="button">CLICK!</a>
<a href="#" title="button">CLICK!</a>
</section>
LESS
section {
width: 700px;
height: 500px;
margin: 250px auto;
position: relative;
background: #08c;
a {
border-radius: 51px;
background: #e60;
line-height: 100px;
text-align: center;
color: #04e;
font-size: 24px;
font-weight: bold;
font-family: tahoma;
text-decoration: none;
display: block;
width: 100px;
height: 100px;
&:nth-child(1){
position: absolute;
top: -100px;
left: -100px;
-webkit-transition: left 2s ease;
&:hover,
&:focus{
left: 800px;
}
}
&:nth-child(2){
position: absolute;
top: -100px;
right: -100px;
-webkit-transition: top 2s ease;
&:hover{
top: 600px;
}
}
&:nth-child(3){
position: absolute;
bottom: -100px;
right: -100px;
-webkit-transition: right 2s ease;
&:hover{
right: 600px;
}
}
&:nth-child(4){
position: absolute;
bottom: -100px;
left: -100px;
-webkit-transition: bottom 2s ease;
&:hover{
bottom: 600px;
}
}
}
}
,但我偶然發現了一個奇怪的東西。當我將鼠標懸停在一個鏈接上時,它將開始移動到懸停時使用的正確位置,但是在某個時刻(總是不同),效果會停止並恢復到原來的位置!
有沒有人看過這個,知道是什麼問題?
爲了方便起見,您可以重新發布代碼(最好是jsfiddle)嗎?它看起來像複製粘貼中有一些變形,因爲它缺少標籤中的字符。 –
不錯的效果)http://jsbin.com/anitob/1 – dmi3y