Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery cycle -- destroyed a cycle with autostop, restarted it, now it stops on the 2nd slide instead of going through them all
    primarykey
    data
    text
    <p>I have a jQuery cycle slider (.team_spotlight) that has 9 slides. It is set to autostop. After autostop, it should trigger a custom function that destroys the slider, then restarts everything.</p> <p>The first time the slider goes through all 9 slides, it works great. However, after the slider is destroyed, then restarts, it stops on the second slide, instead of cycling through all 9.</p> <p>The reason for this weird setup is I have a custom class ("flip") being added to my pager each time a slide advances. You can envision my pager like this -- Active page is yellow, previous pages are red, upcoming pages are green. I also insert unique IDs into each page so I can do a few more style things.</p> <p>Once I'm done with all the slides, I need to reset my pager because I need all the pages to be green again when we loop back around to the first slide. Hence, the destroy and restart of the cycle.</p> <p>If there is a better way to achieve this color effect (without having to destroy the slider), I'm all ears. Otherwise, I need a fix as to why the cycle gets "stuck" on the second slide after being destroyed and restarted.</p> <p>My javascript:</p> <pre><code>function paginate(ind, el) { return '&lt;a class="slidenav" id="slide' + ind + '"&gt;&lt;/a&gt;'; } function shifttab() { $('.activeSlide').addClass('flip'); } function resettabs() { $('.team_spotlight').cycle('destroy'); tabsanim(); } function tabsanim() { $('.team_spotlight').cycle({ fx: 'fade', pause: 1, speed: 0, timeout: 4000, cleartypeNoBg: true, pager: '#pagernav', pagerAnchorBuilder: paginate, pagerEvent: null, after: shifttab, autostop: 1, end: resettabs }); } $(document).ready(function() { tabsanim(); }); </code></pre> <p><strong>EDIT:</strong></p> <p>The destroy bug still stands, and it would be useful to fix it.</p> <p>However, I've been able to duplicate the effect I want by manipulating my current page and its <em>siblings</em>. I no longer have a need to destroy and restart the slider.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload