title: execute my setTimeout function after clicking stops
body: <p>I have a click event where once you click the div, it is adding and removing classes from two other divs. </p>
  
  <p>Then I have a setTimeout function where it is reversing the classes it added and removed from the two other divs. </p>
  
  <p>The thing is, I need the setTimeout to execute after the clicking stops. </p>
  
  <p>Is there a way to check for the click event to end before the setTimeout can execute? </p>
  
  <p>Everything works but I need it to not do setTimeout until the clicking stops.</p>
  
  <p>Here is my Code: </p>
  
  <pre><code>$(".plus").click(function() {
      $(".reg-state").removeClass("active");
      $(".reg-state").addClass("hidden");
      $(".hot-state").removeClass("hidden");  
      $(".hot-state").addClass("active");
  
      setTImeout(function() {
          $(".reg-state").removeClass("hidden");
          $(".reg-state").addClass("active");
          $(".hot-state").removeClass("active");           
          $(".hot-state").addClass("hidden");
      }, 2000);
  });
  
  &lt;div class="plus"&gt;&lt;/div&gt;
  &lt;img class="reg-state active" src="images/SVG/circle.svg"&gt;
  &lt;img class="hot-state hidden" src="images/SVG/circlered.svg"&gt;
  </code></pre>