title: Stop Running function jQuery
body: <p>I need to stop a function in jQuery, I tried <code>preventStop()</code> but I think the syntax is wrong, this is the code:</p>
  
  <pre><code>function changeColor(curNumber){
          curNumber++;
  
          if(curNumber &gt; 3){
              curNumber = 1;
          }
  
          $('body').removeClass().addClass('bgColor' + curNumber);
          setTimeout(function(){changeColor(curNumber)}, 600);
  }
      changeColor(0);
  </code></pre>
  
  <p>As you can see, I'm changing the class, now, I want to stop that action if the user clicks over the document</p>
  
  <pre><code>$('body').click(function(event){
          event.stopPropagation();
      })
  </code></pre>
  
  <p>Something like that didn't worked for me.</p>