我嘗試更改我的Sharepoint2010網站的QuickLaunchMenu以使用手風琴風格。Sharepoint2010 - QuickLaunchMenu手風琴風格
如何獲取當前選定的項目?是否有可能向當前(活動)導航項添加一個CSS類? 如何添加第三個層次結構?
這是我的jQuery代碼:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#s4-leftpanel-content li.static>ul.static").each(function(){
$(this).hide();
});
$("#s4-leftpanel-content ul.root>li.static>a").click(function(ev){
//ev.preventDefault();
var child = $(this).parent().children('ul');
$("#s4-leftpanel-content li.static>ul.static").each(function(){
$(this).hide();
});
child.toggle();
});
//disable heading click
$("#s4-leftpanel-content ul.root>li.static>a").toggle(
function() {},
function() {}
);
});
</script>
,這是我的快速啓動控制:
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
<ContentTemplate>
<SharePoint:AspMenu id="V4QuickLaunchMenu" runat="server" EnableViewState="false"
DataSourceId="QuickLaunchSiteMap"
UseSimpleRendering="true"
UseSeparateCss="false"
SelectStaticItemsOnly="true"
CustomSelectionEnabled="true"
Orientation="Vertical"
StaticDisplayLevels="3"
MaximumDynamicDisplayLevels="2"
SkipLinkText=""
CssClass="s4-ql">
</SharePoint:AspMenu>
</ContentTemplate>
</SharePoint:UIVersionedContent>
任何幫助,將不勝感激。
謝謝!