尝试在悬停时淡出顶部div,以使用JQuery显示下面文本中的工作链接
我需要使用jQuery淡入一个div(和图像)以显示下面的一个div(带有可点击链接的文本)尝试在悬停时淡出顶部div,以使用JQuery显示下面文本中的工作链接,jquery,replace,hover,fadein,fadeout,Jquery,Replace,Hover,Fadein,Fadeout,我需要使用jQuery淡入一个div(和图像)以显示下面的一个div(带有可点击链接的文本) <script> $(document).ready(function(){ $("img.a").hover( function() { $(this).stop().animate({"opacity": "0"}, "slow"); }, function() { $(this).stop().animate({"opacity": "1"}, "slow"); }); }); &l
<script>
$(document).ready(function(){
$("img.a").hover(
function() {
$(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});
});
</script>
$(文档).ready(函数(){
$(“img.a”)。悬停(
函数(){
$(this.stop().animate({“不透明”:“0”},“慢”);
},
函数(){
$(this.stop().animate({“不透明”:“1”},“慢”);
});
});
使用了上面的代码,一切都很好,直到我去点击链接。似乎是顶部隐藏的div阻止了我这么做
尝试了replaceWith函数,这也允许我点击链接,但当我鼠标移出时,无法让它返回到显示原始div。此外,博斯曼希望过渡是渐进的-就像一个褪色
有什么建议吗
非常感谢
Heath好的-在大多数浏览器中,以下两项都可以很好地工作,但在IE中,只要我稍微移动鼠标,div就会开始淡入淡出-并且还可以建立一个fadein/fadeout事件队列或循环:
$(document).ready(function () {
$("#goingimg").hover(
function () { $(".going").fadeOut("normal",0); },
function () { $(".going").fadeTo("normal",1); }
);
});
$(document).ready(function () {
$("#goingimg").hoverIntent(function() {
$(".gone").fadeOut("normal",0);
$('#goingimg').hoverIntent(function(event) { event.stopPropagation(); });
}, function() {
$(".gone").fadeTo("normal",1);
$('#goingimg').hoverIntent(function(event) { event.stopPropagation(); });
});
});
我尝试了建议的hoverIntent插件和event.stopPropagation函数。不过,在IE中,一切都很糟糕。有人知道有什么办法可以解决这个问题吗
非常感谢