title: Sharepoint2010 - QuickLaunchMenu accordion style
body: <p>I try to change QuickLaunchMenu of my Sharepoint2010 site to use accordion style.</p>
  
  <p>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?</p>
  
  <p>This is my jQuery code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function() {
              $("#s4-leftpanel-content li.static&gt;ul.static").each(function(){
                  $(this).hide();
              });
              $("#s4-leftpanel-content ul.root&gt;li.static&gt;a").click(function(ev){
                  //ev.preventDefault();
                  var child = $(this).parent().children('ul');            
                  $("#s4-leftpanel-content li.static&gt;ul.static").each(function(){
                          $(this).hide();            
                  });
                  child.toggle();
              });
              //disable heading click
              $("#s4-leftpanel-content ul.root&gt;li.static&gt;a").toggle(
                  function () {},
                  function () {}
              );
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>and this is my quick launch control:</p>
  
  <pre><code>&lt;SharePoint:UIVersionedContent UIVersion="4" runat="server"&gt;
                          &lt;ContentTemplate&gt;
                              &lt;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"&gt;
                              &lt;/SharePoint:AspMenu&gt;
                          &lt;/ContentTemplate&gt;
                      &lt;/SharePoint:UIVersionedContent&gt;
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>thanks!</p>