title: clicking on link reopens div once closed
body: <p>I have jquery hiding links. I have it so the user can click on the button which closes the list of links underneath. Which makes another list underneath it move up.</p>
  
  <p>Now problem is, when the user clicks on a link, the div that was closed is opened up again.</p>
  
  <p>Is there way to save the state of the div? So if it's closed, keep it closed if the user clicks on a link.</p>
  
  <p>Thanks, just started learning jquery. Here is my code:</p>
  
  <pre><code>       $(document).ready(function() {
          $("#menu_toggle a").click(function() {
              $("#menu_toggle a").toggle();
  
                  if($('#secondary').is(':visible')) {
                      $("#secondary").slideUp("slow");
                          stop(true,true);
                  } else {
                      $("#secondary").slideDown("slow");
                      stop(true,true);
                  }
          });
  
              $("#admin_toggle a").click(function() {
                  $("#admin_toggle a").toggle();              
                  if($('#admin').is(':visible')) {
                      $("#admin").slideUp("slow");
                      stop(true,true);
                  } else {
                      $("#admin").slideDown("slow");
                      stop(true,true);
                  }
  
              });
  
      });
  </code></pre>
  
  <p>here it is on <a href="http://jsfiddle.net/PYbr6/" rel="nofollow">jfiddle</a></p>
  
  <p>now it when I click on the links with # attribute to href it doesn't do anything but on my local server it does.</p>