title: JQuery Stopping ladda animation spinning wheel of death
body: <p>I have a terms &amp; condition checkbox. If it's checked, it submits the form otherwise it throws up an alert. When the alert dialogue box is thrown, the spinning wheel spins for eternity. </p>
  
  <p>I am using the ladda zoom-in gif as listed here: <a href="http://lab.hakim.se/ladda/" rel="noreferrer">http://lab.hakim.se/ladda/</a> </p>
  
  <p>Before clicking on the button, here's the generated html code:</p>
  
  <pre><code>&lt;button type="submit" id="ladda-purple-step4" class="ladda-button ladda captilize step-4-btn" data-color="purple" data-style="zoom-in"&gt;Book appointment now&lt;/button&gt;
  </code></pre>
  
  <p>When spinning begins:</p>
  
  <pre><code>&lt;button type="submit" id="ladda-purple-step4" class="ladda-button ladda captilize step-4-btn" data-color="purple" data-style="zoom-in" disabled data-loading&gt;Book appointment now&lt;/button&gt;
  </code></pre>
  
  <p>For the alert I have:</p>
  
  <pre><code>$('#ladda-purple-step4').unbind('click').click(function (e) {
      if (!document.getElementById('termsagree').checked) {
          e.preventDefault();
          alert("You must accept the Terms &amp; Conditions.");
      }
  });
  </code></pre>
  
  <p>I have managed to stop this on parts of the website using this code:</p>
  
  <pre><code>$('#ladda-purple-step4').on('click', function (e) {
      $('#ladda-purple-step4').attr("disabled", false);
      $('#ladda-purple-step4').removeAttr("data-loading");
  });
  </code></pre>
  
  <p>But it's not working here as this initiates before the spinning begins. My question is, I'm looking for a way to stop the spinning. I was thinking if I can find the attribute data-loading, then fire off my code? What do you recommend? How would I do that?</p>
  
  <p>Thanks</p>