The wrapper parameter is used to stop the carousel in the first cycle. But it remains on the last page after completion.
<div id="carousel-example" class="carousel slide" data-ride="carousel" data-wrap="false">
or
$('.carousel').carousel({ wrap: false });
If you want it to stop on a specific slide, this code will help you achieve this.
var count = 1;
$('.carousel').carousel();
$('.carousel').on('slid.bs.carousel', function () {
count--;
if (count <= 0) {
$('.carousel').carousel('pause');
}
});
{Edit}
Also, if you want to reset the carousel and go to the first page after stopping, add it after a pause
var count = 1;
$('.carousel').carousel();
$('.carousel').on('slid.bs.carousel', function () {
count--;
if (count <= 0) {
$('.carousel').carousel('pause');
setTimeout(function () {
$('.carousel').carousel(0);
}, 200);
}
});
-, , .