Bootstrap Carousel : Remove auto slide

Bootstrap Carousel : Remove auto slide

I’m using Bootstrap Carousel. All I want is that the slider will only slide when a navigation or a pagination is clicked.
I’ve tried removing
$(‘.carousel’).carousel({
interval: 6000
});

It works fine but my problem is once I’ve already clicked a navigation or pagination, it is now auto sliding. Is it possible to remove the auto sliding function? If so, how?

Solutions/Answers:

Solution 1:

Please try adding:

interval: false

that will make the auto sliding stop because there no Milliseconds added and will never slider next.

Solution 2:

From the official docs:

interval The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.

You can either pass this value with javascript or using a data-interval="false" attribute.

Solution 3:

You just need to add one more attribute to your DIV tag which is

data-interval="false"

no need to touch JS!

Solution 4:

Change/Add to data-interval=”false” on carousel div

<div class="carousel slide" data-ride="carousel" data-type="multi" data-interval="false" id="myCarousel">

Solution 5:

Please try the following:

<script>
    $(document).ready(function() {      
        $('.carousel').carousel('pause');
    });
</script>

Solution 6:

data-interval=”false”

Add this to the corresponding div …