Skip to content Skip to sidebar Skip to footer

Bootstrap 2 Carousel Cycle Once And Then Stop

Bootstrap 2 Carousel cycle once and then stop. I suppose I am a bit lost as to how to make this happen! Ive tried cycle and interval but i just cant find enough documentation on ho

Solution 1:

Here is a simple way to obtain what you actually need. Just replace the first line in your code with this one,

<div id="myCarousel" class="carousel slide" data-wrap="false"><!-- Carousel items -->

And then it should cycle only once. Hope this helps you.

Cheers!!!

Solution 2:

You can do something like this

<script>var imgCount = 3;
   $('#myCarousel').carousel({
       interval: 2500
   });
   $('#myCarousel').bind('slid',function(){
      imgCount--;
      if(imgCount == 0)
        $('#myCarousel').carousel('pause');  
   });
</script>

Post a Comment for "Bootstrap 2 Carousel Cycle Once And Then Stop"