您好,欢迎访问一九零五行业门户网

jquery实现带二级菜单的导航示例_jquery

复制代码 代码如下:
$(document).ready(function () {
    $('#top .toolbar1 .centrebox .menu .list1 li').mouseenter(function () {
        var index = $(this).parent().children().index(this);
        $(this).parent().children().each(function () {
            if ($(this).hasclass('select')) {
                $(this).removeclass('select');
            }
        });
        $(this).addclass('select');        $('#top .toolbar2 .centrebox .menu').each(function () {
            if (!$(this).hasclass('hide')) {
                $(this).addclass('hide');
            }
        });
        $('#top .toolbar2 .centrebox .menu').eq(index).removeclass('hide');
    });
    $('#top .toolbar2 .centrebox .menu ul li a').mouseenter(function () {
        var index = $('#top .toolbar2 .centrebox .menu ul li a').index(this);
        $('#top .toolbar2 .centrebox .menu ul li').each(function () {
            if ($(this).hasclass('select')) {
                $(this).removeclass('select');
            }
        });
        $(this).parent().addclass('select');
    });
});
其它类似信息

推荐信息