Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Looking at the source, it looks like the <strong>rev</strong> option is only for animations, which doesn't apply to fade. Here is the exact comment:</p> <pre><code>// causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle) </code></pre> <p>You may be looking for <strong>backwards</strong>:</p> <pre><code>// true to start slideshow at last slide and move backwards through the stack </code></pre> <p>Try setting that to true when you want to reverse the order.</p> <p><strong>EDIT:</strong> There is probably a better way to do this. In any case, here is one way. First, add a click handler to your button that calls some function:</p> <pre><code>function toggleDirection(){ // replace your_slide_div with whatever your div is named $('.your_slide_div').cycle("toggleDirection"); } </code></pre> <p>Then in the cycle plugin JS file, look for the <strong>handleArguments(cont, options, arg2)</strong> function. In the switch statement, add a case:</p> <pre><code>case "toggleDirection": $(cont).data('cycle.opts').backwards = $(cont).data('cycle.opts').backwards ? false : true; if($(cont).data('cycle.opts').backwards) $(cont).data('cycle.opts').nextSlide = $(cont).data('cycle.opts').nextSlide - 2 &lt; 0 ? $(cont).children().length - 1 : $(cont).data('cycle.opts').nextSlide - 2; else $(cont).data('cycle.opts').nextSlide = $(cont).data('cycle.opts').nextSlide + 2 &gt;= $(cont).children().length ? 0 : $(cont).data('cycle.opts').nextSlide + 2; return false; </code></pre> <p><strong>EDIT:</strong> This case assumes that you are sliding through all your images. If you are using the <strong>slideExpr</strong> option, then this will cause problems.</p> <p>Note that this toggles the direction, so clicking the button twice returns it to normal, if you only want it to reverse it, change the case to:</p> <pre><code>(cont).data('cycle.opts').backwards = true; </code></pre> <p><strong>EDIT:</strong> Last one hopefully. In the plugin JS file, do a search for the following:</p> <pre><code>opts.nextSlide &lt; opts.currSlide </code></pre> <p>Replace that specific selection with:</p> <pre><code>opts.currSlide == els.length - 1 </code></pre>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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