-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
54 lines (52 loc) · 1.73 KB
/
script.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
jQuery(document).ready(function($){
$('#mainCarousel').on('slide.bs.carousel', function (e) {
console.log(e.to);
if (e.to == 0) {
$('#mainCarousel .carousel-inner .carousel-item:last')
.remove();
$.get('api.php', function(data) {
$('#mainCarousel .carousel-inner')
.prepend(
$('<div>')
.addClass('carousel-item')
.append($('<img />')
.attr('src', data)
)
);
});
} else if (e.to == 2) {
$('#mainCarousel .carousel-inner .carousel-item:first')
.remove();
$.get('api.php', function(data) {
$('#mainCarousel .carousel-inner')
.append(
$('<div>')
.addClass('carousel-item')
.append($('<img />')
.attr('src', data)
)
);
});
}
});
$.get('api.php', function(data) {
$('#mainCarousel .carousel-inner')
.prepend(
$('<div>')
.addClass('carousel-item')
.append($('<img />')
.attr('src', data)
)
);
});
$.get('api.php', function(data) {
$('#mainCarousel .carousel-inner')
.append(
$('<div>')
.addClass('carousel-item')
.append($('<img />')
.attr('src', data)
)
);
});
})