所以我有这个jQuery代码,我想要悬停某个图像,淡出图像和淡入淡出另一个绝对位置。jQuery fadeIn()fadeOut()表现得像show()和hide()
问题是funcions不会消失,而只是显示和隐藏图像。
的HTML代码
<div class="row">
<div class="col">
<img class="image-without-color">
<img class="image-with-color">
</div>
<div class="col">
<img class="image-without-color">
<img class="image-with-color">
</div>
</div>
jQuery代码:
$('.partner-logo-container').hover(
function(){
$(".image-without-color", this).fadeOut(250);
$(".image-with-color", this).fadeIn(250);
},
function(){
$(".image-with-color", this).fadeOut(250);
$(".image-without-color", this).fadeIn(250);
}
);
谢谢!
你可以做一个小提琴或类似的东西,所以我们可以弄清楚发生了什么问题呢? – Curiousdev
'.fadeOut'和'.fadeIn'从来不能很好地协同工作。尝试在第二个使用'.hide'的单元上使用'.fadeIn'。 –
您可以使用脚本将相关的HTML添加到代码段来演示该问题吗? – Nope