"Carousel slider 3.2"
Bootstrap 3.2.0 Snippet by TomasMDM

<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-md-10 col-md-offset-1"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item active"> <img src="//placehold.it/1024x600" class="img-responsive"> <div class="carousel-caption"> one </div> </div> <div class="item"> <img src="//placehold.it/1024x600/999" class="img-responsive"> <div class="carousel-caption"> two </div> </div> <div class="item"> <img src="http://i.imgur.com/VldsknV.jpg" class="img-responsive"> <div class="carousel-caption"> three </div> </div> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </div> </div> </div>
.selected img { opacity:0.5; }
$('.left').hide(); $('#carousel-example-generic').on('slid.bs.carousel', function (ev) { var carouselData = $(this).data('bs.carousel'); var currentIndex = carouselData.getActiveIndex(); if (currentIndex >= 1) { $('.left').show(); } else { $('.left').hide(); } if (currentIndex === (carouselData.$items.length-1)) { $('.right').hide(); $('.left').show(); } else { $('.right').show(); } })

Related: See More


Questions / Comments: