-1

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?

Vpp Man
  • 2,384
  • 8
  • 43
  • 74

1 Answers1

0

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

Kylie
  • 11,421
  • 11
  • 47
  • 78
  • thanku. i already tried it before asking. but issue was, i was using "a" tags to cover images. And it was giving a blank slider in between and at the end it was showing this blank slider. I thought it was not working! Removed anchor elements and it works. – Vpp Man Jun 22 '13 at 20:08
  • my slideshow is dynamic - ie, the number of slides is unknown. how can it work in this case? thanks – kneidels Oct 23 '14 at 10:34