title: jQuery Cycle - 'before' function to complete before animating to the next slide
body: <p>I'm using the jQuery Cycle plugin for a slider - I need to complete a function when the next link is clicked before the slider moves onto the next slide.</p>
  
  <p>At the moment I can't see anyway to prevent the next action firing before the 'before' function is complete. I'm using the code below.</p>
  
  <pre><code>$('#marques-slider').cycle({
  fx: 'scrollHorz',
  transition: 'scrollHorz',
  timeout:  0,
  prev:    '#prev-slide',
      next:    '#next-slide',
      pager:   '#nav', 
      easing: 'easeInOutExpo',
      speed:  1000,
      before:  slideUp, 
      after:   slideDown,
      startingSlide: 1
  });
  </code></pre>
  
  <p>At present both my onBefore function and the next slide function are animating at the same time.</p>
  
  <p>I also tried creating the next links outside of the plugin:</p>
  
  <pre><code>            $('#next-slide').click(function(){
                  $('.marques-product-content').animate({
                      height : '0'
                  }, function(){
                      $('#marques-slider').cycle('next');
                  });
                  return false;
              });
  </code></pre>
  
  <p>but this causes some funky behaviour with the slides backfground images changing before animating and the function is only working on the first click :/</p>