我正在使用此脚本在图标上淡入淡出。jquery淡入/淡出悬停问题 - 停止闪烁!
我也想隐藏以前的形象,一旦顶部图像完成衰落。
我遇到的问题是,当你将鼠标悬停在它似乎闪烁在消失之前。我需要闪烁停止!
以下是我的HTML和jQuery代码。我试图让这个代码有点普遍。
.link-container {
position: relative;
cursor: pointer;
float: left;
}
.title-hover {
background-position: 0 -106px;
width: 320px;
height: 33px;
margin: -32px 0 0 56px;
display: none;
z-index: 2;
}
.title {
background-position: 0 -63px;
width: 320px;
height: 33px;
margin: -32px 0 0 56px;
}
<div class="link-container">
<div class="main-tile hover-init title"></div>
<div class="main-tile title-hover"></div>
</div>
$(function() {
$(".link-container").hover(function() {
$(".hover-init", this).next().stop(true, true).fadeIn(400);
$(".hover-init", this).hide();
}, function() {
$(".hover-init", this).next().stop(true, true).fadeOut(400);
$(".hover-init", this).show();
});
});
你没有发布HTML,只是CSS。 –
这里的jquery老是最新版本以及html。 Id喜欢淡化.next,然后隐藏hover-init。然后到相反的淡出。 您建议的方法有效,但它并不隐藏悬停init,它只是将另一个.next淡出,这看起来不太好=/ –
您正在回答我的回答吗? – Cystack