Reputation: 3227
I have the same query as the below post, but I couldn't get it to work.
Carousel - Twitter BootStrap ; Hiding the Previous or Next button.
Here is my jsfiidle
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="carousel-inner">
<div class="active item"><img src="http://twitter.github.io/bootstrap/assets/img/bootstrap-mdo-sfmoma-01.jpg">
</div>
<div class="item"><img src="http://twitter.github.io/bootstrap/assets/img/bootstrap-mdo-sfmoma-02.jpg"></div>
<div class="item"><img src="http://twitter.github.io/bootstrap/assets/img/bootstrap-mdo-sfmoma-03.jpg"></div>
</div>
</div>
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
</div>
$(document).ready(function () {
// -------- Initialise Carousel -------- //
$('.carousel').each(function(){
$(this).carousel({
interval: false
})
});
});
Upvotes: 1
Views: 4365
Reputation: 9722
I just made a quick example, basically it's listening to the slid
event and every time the slide animation is done it will check which one the active slide is, based on that you can check whether it's the first or the last one.
Upvotes: 1