title: Is this a candidate for javascript Closure?
body: <p>I go this code working. But, I've been thinking if this is a candidate for implementing closure. Hear me out. </p>
  
  <p>I want to do this:</p>
  
  <pre><code>$(".trigger").click(function() {    
      $(this).parents(".heading").next(".list").slideToggle("slow", function() {
          $(this).toggleClass("close");
          $(this).parents(".heading").toggleClass("close");
      });
  
  });    
  </code></pre>
  
  <p>The problem when the execution is in side <code>slideToggle</code> function <code>this</code> doesn't seem to point to <code>trigger</code>. I found a work around doing this:</p>
  
  <pre><code>$(".trigger").click(function() {    
      var self = $(this);
      $(this).parents(".heading").next(".list").slideToggle("slow", function() {
          $(self).toggleClass("close");
          $(self).parents(".heading").toggleClass("close");
      });  
  });
  </code></pre>
  
  <p>It works. But I am wondering if its a good candidate for implementing closure? And improve code quality, in the process. Thanks. </p>