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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top