Question

I am using jquery cycle plugin to display a basic slider. I have 5 images.

Code is :

$(function(){
  $('#slider').cycle();
});

But I want to show the 5 images and at the end of it, stop the animation and keep the last image displayed in it.

I mean, it should not repeat showing the sliders again. Should stop after the slides are shown once.

How to do this?

Was it helpful?

Solution

The cycle plugin takes autostop as an option parameter... Just pass in the specified parameter....assuming 5 is the amount of slides you wanna stop at...

$(function(){
$('#slider').cycle({autostop:5});
 });

Plugins usually allow various options, and its good to refer to the documentation when trying to modify settings.

You can see a list of all available options for this Cycle plugin here...

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top