title: js nav to remain opened when on visited link
body: <p>Again using this, the best place on the net, to try and resolve a question of a poor designer with extremely limited developer skills;</p>
  
  <p>I have this js nav bar which I need to remain opened once I click on one of the links within the dropdown link. It's hard for me to explain but I'm sure once you see it you'll understand what I mean:</p>
  
  <pre><code>&lt;div id="Nav"&gt;
          &lt;ul&gt;
                  &lt;li&gt;&lt;a href="index.html"&gt;Inicio&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="historia.html"&gt;Historia&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="quienes.html"&gt;Qui&amp;eacute;nes&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
                  &lt;ul id="nav"&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Galer&amp;iacute;a&lt;/a&gt;
                          &lt;ul class="SubLinks"&gt;
                              &lt;li&gt;&lt;a href="proyecto1.html"&gt;Proyecto1&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="proyecto2.html"&gt;Proyecto2&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="proyecto3.html"&gt;Proyecto3&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="contacto.html"&gt;Contacto&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/ul&gt;
  
          &lt;/div&gt; 
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$(document).ready(function(){
  $("#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>Anyone can help?</p>
  
  <p>Thanks guys!!</p>