Any way to make jQuery cycle not loop when reaching the end or the beginning?
Asked Answered
B

2

5

I realize that the plugin is called CYCLE because it cycles throgh the element of the list. But what I like most about it is its flexibility, so I was wondering if there is any way to make the plugin not cycle. So if you try to go to the previous slide when on the first one, or to the next slide when on the last one, it just stops.

I've been reading through the options and the code but cant find the solution

Berstine answered 4/8, 2011 at 15:34 Comment(0)
T
9

http://jquery.malsup.com/cycle/options.html

Check out the nowrap property. (See http://jquery.malsup.com/cycle/nowrap2.html) Set it to nowrap: 1 and your show will stop after each slide has been played 1 time. This is clearly the option you'd need.

Tiffaneytiffani answered 4/8, 2011 at 15:40 Comment(3)
Shit, so there was an option. I guess I didnt know what wrap meant in that context. Thanks!Berstine
nice one, I've never seen that option before.Tourer
Thank you! This api property's name is so not connected to what it really is - infinite:true||falseWeismannism
W
0

Using this slider: http://slidesjs.com/

The y() function in the slides.js pauses the slider. So if you wanted to stop on slide 4...

animationComplete: function(current){ 
    if(current == 4) { 
      y();  
    } else {    
      /* default animate slide code */
    };                       
},
Widera answered 12/2, 2013 at 1:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.