title: Use $(this) in an external function
body: <p>I have a question more out of curiosity. I have written the following code</p>
  
  <pre><code>function checkBox() {
  if($(this).prev().is('.click-animation')) {
     TweenMax.to(this, 0.5, {
         background: 'red'
     });
  } else {
      TweenMax.to(this, 0.5, {
          background: 'green'
      });
  }    
  </code></pre>
  
  <p>}</p>
  
  <pre><code>$('.click-animation').on('click', function() {
      checkBox();
  });
  </code></pre>
  
  <p>And this way it will not activate. Possibly because it cannot define <code>$(this)</code> and I'd like to know why.</p>
  
  <p>Now the function works if I just past it inside the click event it's only when I take it to an outside function that it does nothing.</p>
  
  <p>So why does it not recognize <code>$(this)</code> and what can I do to use it if I were to use an outside function.</p>
  
  <p>Thank you very much</p>