title: Accordion menu expand - menu change
body: <p>In the vertical accordion menu, i want to replace the menu content with other menu or a division. This is my code</p>
  
  <pre><code>&lt;nav&gt;
    &lt;ul id="nav"&gt;
      &lt;li&gt;&lt;a href="#"&gt;Menu 1&lt;/a&gt;
             &lt;div&gt; New Menu 1&lt;/div&gt; 
        &lt;ul&gt;
          After clicking on each header we will show/hide the internal navigation links. This situation can get tricky when trying to implement sub-navigation and sub-sub-navigation if you want to show/hide those as well. A better solution is to nest a third  element which is also displayed immediately with all the other links, but rendered using additional padding.
  
  
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Menu 2&lt;/a&gt;
           &lt;div&gt; New Menu 2&lt;/div&gt;
        &lt;ul&gt;
          Create html drop down menus for web page navigation in a few clicks! Define text, font, color, URL and more for the multilevel dropdown menus. You don't need to write any code by yourself. Horizontal drop down menus builder will generate it for you. You can preview menus in web browser without quitting the program. Css drop down menus render perfectly in Firefox, Safari and Chrome. Html drop down menus also works on non-CSS3 compitable browsers
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Menu 3&lt;/a&gt;
           &lt;div&gt; New Menu 3&lt;/div&gt;
        &lt;ul&gt;
          PURE CSS Menu Maker is a free and powerful graphical user interface for creating 100% pure CSS web menus. CSS menus do not require JavaScript or plug-ins in order to run. PURE CSS Menu Maker can create horizontal as well as vertical menus. Menus generated with PURE CSS Menu Maker may be modified freely, either with PURE CSS Menu Maker or by hand.
        &lt;/ul&gt;
      &lt;/li&gt;
  
    &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>script</p>
  
  <pre><code> $(document).ready(function()
  {
    $('#nav &gt; li &gt; ul:eq(0)').show();
    $("#nav &gt; li &gt; a").on("click", function(e)
    {
      if($(this).parent().has("ul")) 
      {
  
          e.preventDefault();
      }
  
      if(!$(this).hasClass("open")) 
      {
        // hide any open menus and remove all other classes
        $("#nav li ul").slideUp(350);
  
        $("#nav li a").removeClass("open");
  
  
        // open our new menu and add the open class
        $(this).next("ul").slideDown(350);
  
        $(this).addClass("open");
  
      }
  
      else if($(this).hasClass("open")) {
        $(this).removeClass("open");
        $(this).next("ul").slideUp(350);
      }
    });
  });
  </code></pre>
  
  <p>On click i want to change the menu with div and hide that div on next menu click. How it can done? Thanks.</p>
  
  <p>here is a fiddle :
  <a href="http://jsfiddle.net/sW96K/" rel="nofollow">http://jsfiddle.net/sW96K/</a></p>