HTML
xxxxxxxxxx
1
<!--Carousel Wrapper-->
2
<div id="carousel-example-1" class="carousel slide carousel-fade" data-ride="carousel" data-interval="false">
3
<!--Indicators-->
4
<ol class="carousel-indicators">
5
<li data-target="#carousel-example-1" data-slide-to="0" class="active"></li>
6
<li data-target="#carousel-example-1" data-slide-to="1"></li>
7
<li data-target="#carousel-example-1" data-slide-to="2"></li>
8
</ol>
9
<!--/.Indicators-->
10
11
<!--Slides-->
12
<div class="carousel-inner" role="listbox">
13
14
<!--First slide-->
15
<div class="carousel-item active">
16
<!--Mask-->
17
<div class="view hm-black-light">
18
19
</div>
20
<!--/.Mask-->
21
</div>
22
<!--/.First slide-->
23
24
<!--Second slide -->
25
<div class="carousel-item">
26
<!--Mask-->
27
<div class="view hm-black-light">
28
29
</div>
30
<!--/.Mask-->
31
</div>
32
<!--/.Second slide -->
33
34
<!--Third slide-->
35
<div class="carousel-item">
36
<!--Mask-->
37
<div class="view hm-black-light">
38
39
</div>
40
<!--/.Mask-->
41
</div>
42
<!--/.Third slide-->
43
</div>
44
<!--/.Slides-->
45
46
<!--Controls-->
47
<a class="left carousel-control" href="#carousel-example-1" role="button" data-slide="prev">
48
<span class="icon-prev" aria-hidden="true"></span>
49
<span class="sr-only">Previous</span>
50
</a>
51
<a class="right carousel-control" href="#carousel-example-1" role="button" data-slide="next">
52
<span class="icon-next" aria-hidden="true"></span>
53
<span class="sr-only">Next</span>
54
</a>
55
<!--/.Controls-->
56
</div>
57
<!--/.Carousel Wrapper-->
58
<!--/.Main layout-->
59
60
CSS
xxxxxxxxxx
1
/* TEMPLATE STYLES */
2
/* Necessary for full page carousel*/
3
4
html,
5
body,
6
.view {
7
height: 100%;
8
}
9
/* Navigation*/
10
11
.navbar {
12
background-color: transparent;
13
}
14
15
.scrolling-navbar {
16
-webkit-transition: background .5s ease-in-out, padding .5s ease-in-out;
17
-moz-transition: background .5s ease-in-out, padding .5s ease-in-out;
18
transition: background .5s ease-in-out, padding .5s ease-in-out;
19
}
20
21
.top-nav-collapse {
22
background-color: #1C2331;
23
}
24
25
footer.page-footer {
26
background-color: #1C2331;
27
margin-top: 0;
28
}
29
30
@media only screen and (max-width: 768px) {
31
.navbar {
32
background-color: #1C2331;
33
}
34
}
35
/* Carousel*/
36
37
.carousel,
38
.carousel-item,
39
.active {
40
height: 100%;
41
}
42
43
.carousel-inner {
44
height: 100%;
45
}
46
47
.carousel-item:nth-child(1) {
48
background-image: url("http://mdbootstrap.com/images/regular/nature/img%20(54).jpg");
49
background-repeat: no-repeat;
50
background-size: cover;
51
}
52
53
.carousel-item:nth-child(2) {
54
background-image: url("http://mdbootstrap.com/images/regular/nature/img%20(41).jpg");
55
background-repeat: no-repeat;
56
background-size: cover;
57
}
58
59
.carousel-item:nth-child(3) {
60
background-image: url("http://mdbootstrap.com/images/regular/nature/img%20(35).jpg");
61
background-repeat: no-repeat;
62
background-size: cover;
63
}
64
/*Caption*/
65
66
.flex-center {
67
color: #fff;
68
}
69
70
@media (min-width: 776px) {
71
.carousel .view ul li {
72
display: inline;
73
}
74
.carousel .view .full-bg-img ul li .flex-item {
75
margin-bottom: 1.5rem;
76
}
77
}
JS
xxxxxxxxxx
1
$(document).ready(function () {
2
$('#carousel-example-1').hammer().on('swipeleft', function () {
3
$(this).carousel('next');
4
})
5
$('#carousel-example-1').hammer().on('swiperight', function () {
6
$(this).carousel('prev');
7
})
8
});
Console errors: 0