title: How to fire an event when a slide change
body: <p>I am integrating a flexslider into a site. <a href="http://flexslider.woothemes.com/index.html" rel="noreferrer">http://flexslider.woothemes.com/index.html</a></p>
  
  <p>Now, I wish to add a class before and after to the current slide. Every time when the current slide changes, the classes will be updated. I managed to do it with the following jquery:</p>
  
  <pre><code>  setInterval(checkCurrent, 100);
  
    function checkCurrent(){
      $('.gallery #slider li').removeClass('beforeCurrent afterCurrent');
  
      var current = $('.gallery #slider li.flex-active-slide');
  
      current.prev().addClass('beforeCurrent');
      current.next().addClass('afterCurrent');
    }
  </code></pre>
  
  <p>However, this way it will run the function every 100 milliseconds which I think less sensible. I don't intend to use any function flexslider provides as I need to apply the same to other slider plugin in the future. I need purely a jquery solution. Any suggestion ?</p>