目前我有this,當鼠標懸停在容器DIV上時,從容器DIV的頂部滑動到中心的一個小DIV;但在鼠標懸停的時候,它會回退到它來自哪裏。我想要做的是讓DIV從DIV的另一側滑出,直接在DIV的對面。動畫部分工作,但不完全
這可能只使用CSS? (我用jQuery想象它會更簡單)
<div class="blocks">
<div class="blocks_title">
</div>
</div>
<div class="blocks">
<div class="blocks_title">
</div>
</div>
.blocks {
position: relative;
float: left;
margin: 20px;
width: 100px;
height: 100px;
border: 1px dotted #333;
overflow: hidden;
}
.blocks_title {
position: relative;
width: 20px;
height: 20px;
top: 0px;
left: 40px;
background: #333;
opacity: 0;
-webkit-transition: all .25s;
-moz-transition: all .25s;
transition: all .25s;
}
.blocks:hover .blocks_title {
top: 40px;
opacity: 1;
}
.25s所以,你不希望的jQuery/JavaScript的? – Chris
我相信我可以用JQuery來做到這一點,但是很想看看有人可以用CSS來完成這一切。 – Andy
有趣的一個,乍一看沒有,但我想要考慮是否可以用一個巧妙的背景圖像做一些事情來創建它的幻覺 - 但是如果我能想到任何東西,我會很難過去用jQuery;) – efreeman