"Carousel Side-Caption"
Bootstrap 3.1.0 Snippet by jeffsee55

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item active"> <div class="holder col-sm-8"> <img class="img-responsive" src="http://placehold.it/1000x400" alt="..."> </div> <div class="col-sm-4"> <div class="carousel-caption"> <h2>Slide 1</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.</p> <button type="button" class="btn btn-default">Default</button> </div> </div> </div> <div class="item"> <div class="holder col-sm-8"> <img class="img-responsive" src="http://placehold.it/1000x400" alt="..."> </div> <div class="col-sm-4"> <div class="carousel-caption"> <h2>Slide 2</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.</p> <button type="button" class="btn btn-default">Default</button> </div> </div> </div> <div class="item"> <div class="holder col-sm-8"> <img class="img-responsive" src="http://placehold.it/1000x400" alt="..."> </div> <div class="col-sm-4"> <div class="carousel-caption"> <h2>Slide 3</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.</p> <button type="button" class="btn btn-default">Default</button> </div> </div> </div> </div> <div class="controllers col-sm-8 col-xs-12"> <!-- 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> <!-- 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> </div>
.carousel-caption { position: relative; left: 0%; right: 0%; bottom: 0px; z-index: 10; padding-top: 0px; padding-bottom: 0px; color: #000; text-shadow: none; & .btn { text-shadow: none; // No shadow for button elements in carousel-caption } } .carousel { position: relative; } .controllers { position: absolute; top: 0px; } .carousel-control.left, .carousel-control.right { background-image: none; }
$(window).bind("load resize slid.bs.carousel", function() { var imageHeight = $(".active .holder").height(); $(".controllers").height( imageHeight ); console.log("Slid"); });

Questions / Comments:

My header and captions are well above the images, they end up behind my header image. Does anyone have a solution?

Savina Fierro (0) - 1 year ago - Reply 0


Found the problem! The bootstrap.min.css was getting in the way of my new css

Savina Fierro (0) - 1 year ago - Reply 0


How can i force the arrow to he left beside articles, and change the bullet to be line, thanks for respond :D

freddy (0) - 2 years ago - Reply 0


Solved by change col-sm-8 become sm-12

<div class="controllers col-sm-12 col-xs-12">









<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>

</div>

freddy (0) - 2 years ago - Reply 0


seems it look like i need it !
will try it soon !

freddy (0) - 2 years ago - Reply 0


Works really well, thanks Jeff!

Doug Montgomery (0) - 2 years ago - Reply 0


it's very very Nice :)

aliturki (0) - 2 years ago - Reply 0


hello all, could you tell me how to increase or descrease its speed ?

Hom Kimhim (0) - 2 years ago - Reply 0


where is best to put the js? and how...

richiebee (0) - 3 years ago - Reply 0


Related: See More