Sharepoint导航菜单崩溃

时间:2009-08-25 11:31:36

标签: sharepoint menu navigation collapse

有没有人知道在sharepoint中你在网站设置导航中创建了一个导航结构/我只能在标题下添加一个页面并且必须隐藏标题的页面?

单击顶部菜单而不是立即显示时,如何使菜单折叠?

我希望在点击第一个级别时显示第二个级别,然后点击第二个级别,第一个级别用于第一个级别,第二个和第三个级别显示,第二个和第三个级别可以轻松返回主页。

如何在不使用发布网站的门户网站中完成此操作?任何建议都将不胜感激。

1 个答案:

答案 0 :(得分:0)

Jquery是这样的:

<script type="text/javascript" src=http://yourMoss/sites/Shared%20Documents/jquery-x.x.x.js></script>
<script type="text/javascript">
$(function(){
//initialize menus
    var menuRows = $("[id$='QuickLaunchMenu'] > tbody > tr");
    var menuHd = menuRows.filter("[id!='']:has(+tr[id=''])");
    //set img path for when submenu is hidden
    var closedImg = "/_layouts/images/plus.gif";
    //set img path for when submenu is visible
    var openedImg = "/_layouts/images/minus.gif";
    var cssInit = {
        "background-image": "url('"+closedImg+"')",
        "background-repeat": "no-repeat",
        "background-position": "100% 50%"
    }
    var cssClosed = {"background-image": "url('"+closedImg+"')"}
    var cssOpen = {"background-image": "url('"+openedImg+"')"}
    //hide submenus
    menuRows.filter("[id='']").hide();
    //apply initial inline style to menu headers
    menuHd.find("td:last").css(cssInit);
    menuHd.click(function () { 
        var styleElm = $(this).find("td:last")
        var nextTR = $(this).next("tr[id='']");
        if (nextTR.is(':visible')) {
            nextTR.hide();
            styleElm.css(cssClosed);
        } else {
            nextTR.show();
            styleElm.css(cssOpen);
        }
    });
});
</script>