title: jquery Accordion open and close
body: <p>For a FAQ-site I user this little snippet for opening the questions</p>
  
  <pre><code>var allPanels = $('.accordion &gt; dd').hide();
  $('.accordion &gt; dt &gt; a').click(function() {
     allPanels.slideUp();
     $(this).parent().next().slideDown();
     return false;
  });
  </code></pre>
  
  <p>This works fine and if I click on the second question the first answer will be hidden.</p>
  
  <p>How does it work so I can click on the first question and another click on the first question would hide the first answer.</p>