Jquery Cycle - Set Duration for each Slide


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(function() {
  2. $('#animationBlock').cycle({
  3. delay: -1000,
  4. fx: 'fade',
  5. speed: '1000',
  6. timeoutFn: calculateTimeout
  7. });
  8. });
  9.  
  10. // timeouts per slide (in seconds)
  11. var timeouts = [3, 3, 3, 3, 10];
  12. function calculateTimeout(currElement, nextElement, opts, isForward) {
  13. var index = opts.currSlide;
  14. return timeouts[index] * 1000;
  15. }

URL: http://jquery.malsup.com/cycle/timeout2.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.