title: How to determine if a bootstrap collapse is opening or closing?
body: <p>If I have a bootstrap collapse how can I determine from a click event wether the collapse is opening or closing?</p>
  
  <p>Here is my click event or maybe there is a better way then to use a click event?</p>
  
  <pre><code>$(document).on("click", "a.register-student-link", function() {
      // do some stuff to check if opening or closing
  }
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;a id=@space.EventId class="register-student-link" data-toggle="collapse" href=@spaceIdWith aria-expanded="false" aria-controls="collapseExample"&gt;
                                                      Register Student
                                                  &lt;/a&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>