I try to change QuickLaunchMenu of my Sharepoint2010 site to use accordion style.
How can I get the current selected item? Is there a possibility to add a css class to the current (active) nav-item? How can I add a third hierarchy level?
This is my jQuery code:
<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>
and this is my quick launch control:
<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>
Any help would be appreciated.
thanks!