title: jQuery toggle if NOT this
body: <p>Forgive me if this is a newbie question:</p>
  
  <p>I've got a menu set to open the next div to see more details, and if there is another div open already it will close it while it opens the new one. I cannot figure out how to close the div already open if you click on the header associated with that div. It just closes &amp; reopens.</p>
  
  <p>Code:</p>
  
  <pre><code>$(document).ready(function() {
  
      $(".heading").click(function(){
          if($(".content").is(":visible")){
              $(".less").removeClass("less");
              $(".content").slideUp(500);
          }
          $(this).next(".content").slideToggle(500);
          $(this).children(".more").toggleClass("less");
      });
  
  });
  </code></pre>
  
  <p>Any help is appreciated.</p>