我有一个具有 mouseover jquery 功能的图像:
$(document).ready(function ()) {
mouseenter: function () {
$(this).children('.item_450_description').stop().fadeTo(500, 1);
},
mouseleave: function () {
$(this).children('.item_450_description').stop().fadeTo(500, 0);
}
});
当您使用鼠标光标输入图像时,会显示说明。描述包含图像和文本:
<div class="item_450_image">
<a class="item_popup" href="popup.php?id=1?>"><img src="pic.jpg" class="img_450" /></a>
<div class="item_450_description">
<p class="title">Title</p>
<p class="poster">by poster</p>
<div class="item_poster">
<img src="user.jpg" class="img_poster" />
</div>
</div>
</div>
当您用光标离开图像时,描述就会消失。这在 IE9、Chrome、Safari 和 Firefox 中运行良好。但是当我在 IE8 中尝试时,我遇到了问题。
当我用光标输入图像时,会显示描述(包括图像和文本)。但是当我用光标离开图像时,描述和文本都消失了。但是描述中的图像一直存在并且不会消失。
我怎么解决这个问题?
(附加CSS)
.item_450_image {
text - align: left;
position: relative;
width: 450px;
border - top: 1px solid#cdcdcd; - webkit - border - radius: 5px; - moz - border - radius: 5px;
border - radius: 5px;
margin - left: 5px;
padding: 4px 4px 2px 4px;
background - color: #efefef;
box - shadow: 0 1px 3px rgba(0, 0, 0, 0.5); - moz - box - shadow: 0 1px 3px rgba(0, 0, 0, 0.5); - webkit - box - shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.img_450 {
width: 450px;
}
.item_450_description {
position: absolute;
bottom: 5px;
left: 4px;
width: 450px;
display: none;
background: url('../img/items/bg_description.png');
padding: 5px 0px 5px 0px;
}