"slide show"
Bootstrap 3.0.0 Snippet by evarevirus

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.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 ---------->
<header>
<h1>Bear slideshow </h1>
<p>Bear slideshow, using Bootstrap 3 Default Slidehsow (Carousel).</p>
<p>click on <i class="glyphicon glyphicon-th-list"></i></p>
</header>
<section id="box-slider" class="col-md-7 center-block" style="float:none;">
<div class="panel panel-default">
<div class="panel-heading">
<div class="arrow">
<a class="left carousel-control" href="#slider" role="button" data-slide="next">
<i class="glyphicon glyphicon-chevron-left" aria-hidden="true"></i>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#slider" role="button" data-slide="prev">
<i class="glyphicon glyphicon-chevron-right" aria-hidden="true"></i>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<div id="slider" class="carousel slide" data-ride="carousel">
<div class="indicators-box">
<div id="indicatorsTitle" class="title">
<i id="btnToggleIndicators" class="glyphicon glyphicon-th-list"></i>
</div>
<ol class="carousel-indicators"></ol>
</div>
<div class="carousel-inner" role="listbox">
<div class="item">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
body {
padding: 2rem;
direction: ltr;
background-color: #f2f2f2;
}
header {
text-align: center;
font-family: Roboto Mono;
margin-bottom: 5rem;
}
header h1 {
margin-bottom: 2rem;
}
.github-star {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
padding: 3rem;
}
@media only screen and (max-width: 992px) {
#box-slider {
margin-bottom: 2rem;
}
}
#box-slider .panel {
margin: 0;
position: relative;
}
#box-slider .panel-heading {
display: -webkit-box;
display: -ms-flexbox;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$(document).ready(function() {
$('#box-slider').each(function() {
var self = $(this),
get_item = $('#box-slider .item'),
get_item_length = get_item.length,
indicators = $('#box-slider .carousel-indicators'),
index = "0";
for (index; index < get_item_length; index++) {
indicators.append('<li data-target="#slider" data-slide-to=" ' + index + ' "></li>');
}
indicators.find('li:first').addClass('active');
get_item.first().addClass('active');
get_item.each(function(i) {
get_item_name = $(this).find('img').data('name');
indicators.find('li:eq(' + i + ')').html(get_item_name);
});
self.each(function() {
var slideIndex = $(this).find('li.active').text();
$('#indicatorsTitle').append('<h4>' + slideIndex + '</h4>');
self.on('slid.bs.carousel', function() {
slideIndex = $(this).find('li.active').text();
$('#indicatorsTitle h4').html(slideIndex);
});
});
$('#btnToggleIndicators').on('click', function() {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: