基本上,当你悬停在菜单上时,我会试着让白盒保持打开。我必须通过css用绝对定位来定位这些框,现在它们只是根据您悬停的菜单项来显示和隐藏。http://cl.ly/1C1c2Q1A3F3k0g1d2R0z
$('.menu-item-156').hover(
function() {
$('.col').fadeIn(200).addClass('expanded');
},
function() {
$('.col').fadeOut(200);
}
);是我现在使用的,而wordpress中的标记是这样的:
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
<div class="col nav_info"><p>View the Fall ’11 Collection, hot off the runway!</p></div>
wordpress会输出包含菜单项的li元素
发布于 2011-07-07 22:28:57
看起来您需要的是mouseover事件,而不是双头hover函数(即mouseover加mouseout)。
$('.menu-item-156').mouseover(function () {
$('.col').fadeIn(200, function () {
$(this).addClass('expanded');
}
});https://stackoverflow.com/questions/6612033
复制相似问题