title: How can I keep a menu open when navigating to another page?
body: <p>I'm using a js code for additional menu options on click, but how can I keep the "click menu" permanently open, say after one of its option has been clicked, so the user won't have to start over again once taken to the new page. </p>
  
  <p>HTML:</p>
  
  <pre><code> &lt;div class="c3" id="topLeftNav"&gt;
                  &lt;ul class="secnav" id="secnav"&gt;                                 
                      &lt;h6&gt;Generelt&lt;/h6&gt; 
                      &lt;li class="current"&gt;&lt;a href="#"&gt;Ordklasser&lt;/a&gt;
                      &lt;ul class="ternav"&gt;
                              &lt;li&gt;&lt;a href="substantiver.html"&gt;Substantiver&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="verber.html"&gt;Verber&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="adjektiver.html"&gt;Adjektiver&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="numeralier.html"&gt;Numeralier&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="interjektioner.html"&gt;Interjektioner&lt;/a&gt;&lt;/li&gt;
                                      &lt;/ul&gt;
  </code></pre>
  
  <p>And my JS:</p>
  
  <pre><code> ///ternav/secnav  -- catch inner clicks (ternav) first and preventDefault.
      $('.ternav li a').click(function () {
          window.location = $(this).attr('href');
      });
  
      //secnav 
      $('li').click(function (event) {
          if ($(this).has('ul').length) {
              event.preventDefault();
              if ($(this).find('ul').css("display") == "none") {
                  $(this).find('a').eq(0).addClass('current');
                  $(this).find('ul').slideDown();
              }
              else {
                  $(this).find('ul').slideUp();
                  $(this).find('a').eq(0).removeClass('current');
              }
          }
      });
  </code></pre>