我正在使用jquery代碼來顯示和隱藏文本div當mousOver在img上。 它工作正常,但是當顯示div時,當mouseOver div時,它隱藏並在mouseOver時再次顯示它。 我想要做的是顯示div時mouseOver圖像,當mouseOver內部圖像和文本div div不隱藏時,我希望div只有當從img的mouseOut隱藏。 問題是我猜,因爲我的div是與位置:絕對,但我必須保持這一點。text div顯示和隱藏在mouseOver img
這裏是我的jQuery:
$(".image_big").hover(function(){
$('.cartouche').show();
},function(){
$('.cartouche').hide();
});
和我的CSS:
.cartouche {display:none;position: absolute;
bottom: 0px;
background-color: #00B252;
color: white;
text-transform: uppercase;
text-align: left;padding: 10px}
.image_big_container{width:473px;height:330px;text-align: center;}
#slideshow{margin-top: 20px;position:relative}
#slideshow_big { margin-bottom:10px}
這裏的jsfiddle看到它在行動:
http://jsfiddle.net/m7zFb/352/
我也將有很多圖片在我的網站上,並且只想從圖像中刪除文本div被選中,有沒有一種方法可以添加一個this.children只將目標放在圖像上我是mouseOver?
希望你明白我的問題,
感謝您的幫助