Take the 2-minute tour ×

I am using jquery cycle plugin with below settings.Photos sliding in given time out well without problem but if i click another tab of browser and wait 10 sn then back to slideshow's tab and i see that slideshow is stopped . It does not pass next photo. What can cause this problem ?

    var slideShow = $('.slideshow-container').cycle({ fx: 'fade', timeout: 3000, speed: 500, fastOnEvent: 1,
        skipInitializationCallbacks: true,
        pause: 1

I am using jQuery 1.6.2 and cycle version 2.9995 (latest).

You can Test it on jsfiddle.net

share|improve this question
Grammar, man, grammar.... "but if i click another tap for 10 sn then re back slideshow and i see slideshow is stopped . Does not pass next photo". What is "another tap" and "for 10 sn" "the re back" ?? –  WTK Sep 6 '11 at 8:44
@WTK - Now is it clear ? I am not native english man :) don't be angry. Just warn me –  AnyOne Sep 6 '11 at 8:53
I'm not native either but at least pay attention to obvious typos :) It's now a lot clearer, I'll check how to solve your issue. –  WTK Sep 6 '11 at 9:03
Which version of jquery cycyle are you using (you can check that in plugin source file)? If you're using option pause: 1 then (according to the documentation) the slideshow is paused until resumed. How do you start/resume cycle in your code then? –  WTK Sep 6 '11 at 9:10
pause: 1 means if mouse is over slide show then pause it until mouse leave it. I will edit question for version infos –  AnyOne Sep 6 '11 at 9:11
show 2 more comments

1 Answer

up vote 2 down vote accepted

All right, I think I got it. It's working now, at least with the options specified by your code. I'm not sure (for I have not tested it) if my implementation will play along nicely with other options that can be passed to cycle plugin.

The reason why this problem has been occuring was that next iteration where transition suppose to occure was setup before completion of previous transition. In some cases, next transition was fired before the previous has finished, at the beginning of that new transition there's a check whenever there's already other animation going on - if so, the function would just return and stop (without setting up next iteration). After the ongoing animation was finished, the slideshow was stopped, because there was no next transition scheduled.

I've forked the cycle plugin on github and published my fix: https://github.com/WTK/cycle

share|improve this answer
You are fearless programmer. I wouldn't even attempt to check source codes. Thank you very much. I will test it ASAP. –  AnyOne Sep 6 '11 at 12:00
I hope it will work for you. –  WTK Sep 6 '11 at 12:03
It works well. I hope they will update latest version quickly –  AnyOne Sep 6 '11 at 14:06
@WTK, the semicolon at start of the file was there for a purpose. It guards from hard-to-debug errors in the case when several JavaScript libraries are concatenated (and probably minified), and the previous one has an erroneous last line, which gets merged with the first line of next library due to semicolon (not-)insertion rules in JavaScript (e.g. a unclosed "return"). –  whitequark Sep 6 '11 at 17:42
Interesting point, I've never heard of this technique. Thanks, I'll update the code in a bit. –  WTK Sep 7 '11 at 6:25
add comment

Your Answer


