title: Remove class from sibling when added to (this), toggle (this)
body: <p>I am building a small gallery that expands and contracts. The parent div expands and the children expand. I want the class "open" to be removed when a sibling is clicked but also want to be able to remove "open" from all ".panel" divs when the currently "open" div is clicked. Also the parent div expands with a class ".full".</p>
  
  <pre><code>$(document).ready(function() {
    $('.panel').on('click', function(e) {
      $('.panel').removeClass("open");
      $(this).toggleClass("open"); //this is not working
      if ($(this).hasClass('open')) {
        $(this).parent().addClass("full");
      } else {
        $(this).parent().removeClass("full");
      }
    });
  });
  </code></pre>