可能是重复问题:
jQuery中最近的祖先节点
HTML:
<div class="post">
<h2><a href="#" title="">Pellentesque</a></h2>
<p><a href="#" title="" class="more">More</a></p>
</div>
jQuery
$('.more').bind("hover", function(){
$(this).parent('.post').hide() ;
});
当鼠标悬停在(.more)上时,我想隐藏帖子,但它没有任何作用。如果我使用parents()代替,它会删除页面上所有的.posts。欢迎任何帮助。