Assuming you are using the Cycle2 plugin by Malsup, then the documentation for the API does not contain an option called autostop
. Perhaps you mean the loop
option?
loop
integer
0
The number of times an auto-advancing slideshow should loop before terminating. If the value is less than 1 then the slideshow will loop continuously. Set to 1 to loop once, etc.
So either:
<ul ... data-cycle-loop="1" .. /></ul>
or
var $slideshow = $('#my-slideshow');
$slideshow.cycle({
speed: 3000,
loop: 1,
timeout: 5000
});
// jump back to the first slide when loop has finished
// you might have to use setTimeout() to delay the transition back to the first slide
$slideshow.on('cycle-finished', function(event, opts) {
$slideshow.cycle('goto', 0);
});