我想將圖像放在我的網站上,當您將鼠標懸停在它上面時,圖像滑落並顯示它後面的文本。當鼠標移動時,jQuery懸停滑塊再次啓動
我已經得到了這個工作,但是如果我在圖像上稍微移動鼠標,它會再次移動。
這裏是jQuery代碼:
$(document).ready(function(){
$('.show').hover(function(){
$(this).animate({top:'400px'});
},function(){
$(this).animate({top:'0px'});
});
});
這裏是CSS:
.hover {
width: 300px;
height: 400px;
background: black;
margin-top: 10px;
overflow: hidden;
position: relative;
}
.show {
width: 300px;
height: 400px;
background: red;
position: absolute;
}
有沒有辦法讓它停止在懸停狀態,直到鼠標完全移出DIV ?
這裏是的jsfiddle的要求JSFIDDLE
貓你UNE小提琴,所以我們可以看到它是如何與HTML – Stphane
我已經添加了的jsfiddle工作: ) – Ollie2619
添加我的答案,與小提琴呢! :) – Stphane