Any way to make jQuery cycle not loop when reaching the end or the beginning?
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
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.
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 */
};
},
精彩评论