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

which version of jQuery it works with? because I used jQuery 3.2.1 and jQuery 2.1.1 and I got error (Uncaught TypeError: $(...).Carousel is not a function...)

vhsedn (-1) - 3 months ago - Reply -1


Your error has $(...).Carousel, with a capital C, where as the code is lower case c.

skyhighpn (1) - 3 months ago - Reply 0


Hi, I was able to get it working on Bootstrap 3.3.7 and jQuery 3.1.1. https://www.bootply.com/Ll8syDOhAJ

LabWorkz (0) - 3 months ago - Reply 0


FYI, The ability to select jquery versions is long overdue, and is coming in the next couple days.

skyhighpn (1) - 3 months ago - Reply 0


Yes that will be great!

LabWorkz (0) - 3 months ago - Reply 0


I corrected that but still got "jquery-3.2.1.js:3869 Uncaught TypeError: $(...).carousel is not a function"

vhsedn (-1) - 3 months ago - Reply 0


This is the jquery that it is using.

https://code.jquery.com/jquery-1.10.2.min.js

skyhighpn (1) - 3 months ago - Reply 0