开发者

jquery hover + wordpress menus

开发者 https://www.devze.com 2023-03-18 12:09 出处:网络
Basically Im trying to keep the white box open when you hover off the menu. I had to position the boxes via css with absolute positioning to right now they are just showing and hiding depending on whi

Basically Im trying to keep the white box open when you hover off the menu. I had to position the boxes via css with absolute positioning to right now they are just showing and hiding depending on which menu-item you hover. http://cl.ly/1C1c2Q1A3F3k0g1d2R0z

    $('.menu-item-156').hover(
function() {
    $('.col').fadeIn(200).add开发者_开发技巧Class('expanded');
},
function() {
    $('.col').fadeOut(200);
}
);

is what im using now and the markup in wordpress is like this:

<?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 spits out li elements containing the menu items


It seems you want the mouseover event, not the two-headed hover function (which is mouseover plus mouseout).

$('.menu-item-156').mouseover(function () {
    $('.col').fadeIn(200, function () {
        $(this).addClass('expanded');
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号