所以我在玩转场/悬停效果,这就是代码。
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>
较少的
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;
}
}
}
}
示例:http: //jsbin.com/anitob/1
但是,我偶然发现了一件奇怪的事情。当我将鼠标悬停在链接上时,它开始到达悬停应用的正确位置,但在某些时候(总是不同)效果停止并返回到原始位置!
有没有人看到这个并知道是什么问题?