我有以下标记:
<div class='mb_post'>
blah blah blah
<div class='mb_footer'>footer info</div>
</div>
mb_footer 将在加载时显示:无,然后我希望将鼠标悬停使其显示。我有:
$('.mb_post').on('mouseover',function(){
$(this'.mb_footer').show();
});
但它不起作用。我如何指定仅存在于其中的 mb_footer?
提前致谢
最佳答案
差点就拥有了...
$('.mb_footer', this).show();
$
函数的第二个参数可以是选择器的上下文。
或者,您可以执行$(this).find('.mb_footer')
。
关于jquery - 指定其中的一个类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13946513/