"Carousel with Gallery Thumbs"
Bootstrap 3.2.0 Snippet by LabWorkz

<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 id="main_area"> <!-- Slider --> <div class="row"> <div class="col-sm-6" id="slider-thumbs"> <!-- Bottom switcher of slider --> <ul class="hide-bullets"> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-0"> <img src="http://placehold.it/150x150&text=zero"> </a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-1"><img src="http://placehold.it/150x150&text=1"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-2"><img src="http://placehold.it/150x150&text=2"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-3"><img src="http://placehold.it/150x150&text=3"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-4"><img src="http://placehold.it/150x150&text=4"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-5"><img src="http://placehold.it/150x150&text=5"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-6"><img src="http://placehold.it/150x150&text=6"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-7"><img src="http://placehold.it/150x150&text=7"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-8"><img src="http://placehold.it/150x150&text=8"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-9"><img src="http://placehold.it/150x150&text=9"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-10"><img src="http://placehold.it/150x150&text=10"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-11"><img src="http://placehold.it/150x150&text=11"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-12"><img src="http://placehold.it/150x150&text=12"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-13"><img src="http://placehold.it/150x150&text=13"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-14"><img src="http://placehold.it/150x150&text=14"></a> </li> <li class="col-sm-3"> <a class="thumbnail" id="carousel-selector-15"><img src="http://placehold.it/150x150&text=15"></a> </li> </ul> </div> <div class="col-sm-6"> <div class="col-xs-12" id="slider"> <!-- Top part of the slider --> <div class="row"> <div class="col-sm-12" id="carousel-bounding-box"> <div class="carousel slide" id="myCarousel"> <!-- Carousel items --> <div class="carousel-inner"> <div class="active item" data-slide-number="0"> <img src="http://placehold.it/470x480&text=zero"></div> <div class="item" data-slide-number="1"> <img src="http://placehold.it/470x480&text=1"></div> <div class="item" data-slide-number="2"> <img src="http://placehold.it/470x480&text=2"></div> <div class="item" data-slide-number="3"> <img src="http://placehold.it/470x480&text=3"></div> <div class="item" data-slide-number="4"> <img src="http://placehold.it/470x480&text=4"></div> <div class="item" data-slide-number="5"> <img src="http://placehold.it/470x480&text=5"></div> <div class="item" data-slide-number="6"> <img src="http://placehold.it/470x480&text=6"></div> <div class="item" data-slide-number="7"> <img src="http://placehold.it/470x480&text=7"></div> <div class="item" data-slide-number="8"> <img src="http://placehold.it/470x480&text=8"></div> <div class="item" data-slide-number="9"> <img src="http://placehold.it/470x480&text=9"></div> <div class="item" data-slide-number="10"> <img src="http://placehold.it/470x480&text=10"></div> <div class="item" data-slide-number="11"> <img src="http://placehold.it/470x480&text=11"></div> <div class="item" data-slide-number="12"> <img src="http://placehold.it/470x480&text=12"></div> <div class="item" data-slide-number="13"> <img src="http://placehold.it/470x480&text=13"></div> <div class="item" data-slide-number="14"> <img src="http://placehold.it/470x480&text=14"></div> <div class="item" data-slide-number="15"> <img src="http://placehold.it/470x480&text=15"></div> </div> <!-- Carousel nav --> <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </div> </div> </div> <!--/Slider--> </div> </div> </div>
.hide-bullets { list-style:none; margin-left: -40px; margin-top:20px; } .thumbnail { padding: 0; } .carousel-inner>.item>img, .carousel-inner>.item>a>img { width: 100%; }
jQuery(document).ready(function($) { $('#myCarousel').carousel({ interval: 5000 }); //Handles the carousel thumbnails $('[id^=carousel-selector-]').click(function () { var id_selector = $(this).attr("id"); try { var id = /-(\d+)$/.exec(id_selector)[1]; console.log(id_selector, id); jQuery('#myCarousel').carousel(parseInt(id)); } catch (e) { console.log('Regex failed!', e); } }); // When the carousel slides, auto update the text $('#myCarousel').on('slid.bs.carousel', function (e) { var id = $('.item.active').data('slide-number'); $('#carousel-text').html($('#slide-content-'+id).html()); }); });

Related: See More

Questions / Comments:

I'm trying to have multiple carousels in one html, but it doesn't work
Can someone help me?

Andrea Sandoval () - 1 year ago - Reply 0

gracias sirvio de mucho

Roberto Román Diaz () - 1 year ago - Reply 0

Excelente muchas gracias

Gammy1988 () - 1 year ago - Reply 0


Joseph Mtinangi () - 2 years ago - Reply 0

Hi everyone. I urgently need help concerning the code. Where should i place the JS part?

Monisha Sungsam () - 2 years ago - Reply 0

Hi, awesome, how can I fix to have another size image, example 400X300 ? Not square, rectangle

alexandra mora () - 2 years ago - Reply 0

im having problem to my this dynamically see my code and tell me where is wrong...

James Allan () - 2 years ago - Reply 0

I am having an issue with it, when I click on an image the carousel doesn't change accordingly. Can anyone help?

Sufian Kayar () - 2 years ago - Reply 0

add js-script at the end

salem ibrahim () - 2 years ago - Reply 0


Bang () - 3 years ago - Reply 0


alessandro () - 3 years ago - Reply 0

how can i increase the number of thumbnails?
thank you!

alessandro () - 3 years ago - Reply 0

Hi Alessandro, did you get this one figured out?

Smart Cuts () - 2 years ago - Reply 0

Another thing:

How can I "float" all the thumbinails to the left when I don't have thumb enough to fill the row?

RBNZ () - 3 years ago - Reply 0

Is great and I like it, but how can I give a style to the active thumb?

RBNZ () - 3 years ago - Reply 0

Not working for me :( - Nuno @ http://www.nuno-sarmento.com

Nuno Sarmento () - 3 years ago - Reply 0

nice, thanks!

KaosNihil () - 3 years ago - Reply 0

awesome one...

Ihsan khan () - 3 years ago - Reply 0