malsup / cycle2

2nd gen cycling
899 stars 239 forks source link

Combining Turn.js and cycle2 #809

Open ignaciosw opened 7 years ago

ignaciosw commented 7 years ago

Hi there! I'm using your plugin in a flipbook. I have 2 sliders in two different pages. When first loaded for the first time, they work great. Since I'm using different kinds of content (images, videos) on each slider, I handle the cycle via the API, not automatically.

Anyway, when I turn the page I pause the cycle, and go to a new one. But whenever I go back, I resume the cycle and that somehow makes the cycle crazy, I can't get my head around it. The "slider active" class switches from one slider to the other in a matter of milliseconds...

so this code will change sliders many times per second:

if(isImage($(slide_selector).find(".cycle-slide-active")[0])){
    slideshowTimeout = 4000;
    setTimeout(function(){
        $(slide_selector).cycle('next');
    }, slideshowTimeout);
}

Oh! and also... if I initiate a cycle on pause, will it already have a .is(".cycle-paused") state? doesn't look like it. Paused state only comes up when it has been paused by either user action or the API?

Thanks!! cycle2 is awesome. Just need to find out why it triggers this strange behaviour...