xxxxxxxxxx
1
<div id="carousel-example-multi" class="carousel slide carousel-multi-item v-2" data-ride="carousel">
2
3
<!--Controls-->
4
<div class="controls-top">
5
<a class="btn-floating" href="#carousel-example-multi" data-slide="prev"><i
6
class="fas fa-chevron-left"></i></a>
7
<a class="btn-floating" href="#carousel-example-multi" data-slide="next"><i
8
class="fas fa-chevron-right"></i></a>
9
</div>
10
<!--/.Controls-->
11
12
<!-- Indicators -->
13
<ol class="carousel-indicators">
14
<li data-target="#carousel-example-multi" data-slide-to="0" class="active"></li>
15
<li data-target="#carousel-example-multi" data-slide-to="1"></li>
16
</ol>
17
<!--/.Indicators-->
18
19
<div class="carousel-inner v-2" role="listbox">
20
21
<div class="carousel-item active">
22
<div class="col-12 col-md-4">
23
<div class="card mb-2">
24
<img class="card-img-top" src="https://mdbootstrap.com/img/Photos/Others/img (36).jpg"
25
alt="Card image cap">
26
<div class="card-body">
27
<h4 class="card-title font-weight-bold">Card title</h4>
28
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the
29
card's content.</p>
30
<a class="btn btn-primary btn-md btn-rounded">Stop</a>
31
</div>
32
</div>
33
</div>
34
</div>
35
<div class="carousel-item">
36
<div class="col-12 col-md-4">
37
<div class="card mb-2">
38
<img class="card-img-top" src="https://mdbootstrap.com/img/Photos/Others/img (34).jpg"
39
alt="Card image cap">
40
<div class="card-body">
41
<h4 class="card-title font-weight-bold">Card title</h4>
42
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the
43
card's content.</p>
44
<a class="btn btn-primary btn-md btn-rounded">Stop</a>
45
</div>
46
</div>
47
</div>
48
</div>
49
50
51
</div>
52
53
</div>
1
1
xxxxxxxxxx
1
$('.carousel.carousel-multi-item.v-2 .carousel-item').each(function(){
2
var next = $(this).next();
3
if (!next.length) {
4
next = $(this).siblings(':first');
5
}
6
next.children(':first-child').clone().appendTo($(this));
7
8
for (var i=0;i<4;i++) {
9
next=next.next();
10
if (!next.length) {
11
next=$(this).siblings(':first');
12
}
13
next.children(':first-child').clone().appendTo($(this));
14
}
15
});
16
17
$('.btn').click(function(){
18
$('#carousel-example-multi').carousel('pause');
19
});
Console errors: 0