title: jQuery trigger event when an object is given a class
body: <p>I am using a jQuery carousel, downloaded from here: <a href="http://www.thomaslanciaux.pro/jquery/jquery_carousel.htm" rel="nofollow">http://www.thomaslanciaux.pro/jquery/jquery_carousel.htm</a></p>
  
  <p>It uses pagination, and applies a class called "active" to the current page number when the page number is clicked. I want to trigger an event to happen when this class is applied, since it also uses left and right arrows to apply the class to the current page number.</p>
  
  <p>Here's the event that I want to be triggered when the class is applied:</p>
  
  <pre><code>$('.red').click(function() {
       $('#formred').attr('checked', 'checked');
   });
  </code></pre>
  
  <p>I have gotten it to work, but only when the page loads:</p>
  
  <pre><code> if ($('.red').hasClass('active')) {
        $('.red').trigger('click');
   }
  </code></pre>
  
  <p>The first page number has the class applied by default, which is why this works when the page loads. I need this to happen as the class is applied to other page numbers.</p>