当我悬停一个元素,然后悬停一个内部元素时,我遇到了麻烦。我不知道它是否是我想要实现的最佳方式。这里是我的代码:jQuery防止悬停儿童闪烁
我的标记:
<div class="wrapper">
<div class="animation">
<a href="#" class="linked"><img src="#"/></a>
<h1 class="title hidden"><a href="#">blabla</a></h1>
</div>
</div>
我的JS:
$('.animation a img').hover(function(){
$(this).parent().next().stop().fadeTo("medium", 1);
$(this).stop().fadeTo("fast", 0);
}, function(){
$(this).parent().next().stop().fadeTo("medium", 0);
$(this).stop().fadeTo("fast", 1);
});
CSS:
#wrapper {margin: 0 auto; width: 960px;}
#hidden {display: none;}
h1 a {bottom: 0; float: left; font-size: 1.5em; left: 0; position: absolute; width: 460px;}
.linked {background: #666; float: left; height: 250px;}
当我将鼠标悬停在H1的闪烁开始。有什么办法可以禁用或修复它吗?
提前致谢!
哪里CSS? – s84 2011-03-14 05:41:14
我没有看到任何闪烁 – 2011-03-14 05:48:26
当你把H1悬停似乎有另一个动画,它是从父母img轻弹不透明,我想停止 – 2011-03-14 05:50:44