-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslideshow.php
43 lines (43 loc) · 1.04 KB
/
slideshow.php
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
<style type = 'text/CSS'>
.carousel-item img {
display: block;
margin: auto;
height: 50vh;
}
.carousel {
background-color: black;
}
</style>
<div id = 'slide-show' class = 'carousel slide' data-ride = 'carousel'>
<ul class = 'carousel-indicators'>
<?php
for ($i = 1; $i <= count(glob("/img/ss/" . "*.jpg")); $i++) {
echo "<li data-target = '#slide-show' data-slide-to = '{$i}'";
if ($i == 1) {
echo " class = 'active'></li>";
} else {
echo "></li>";
}
}
echo "
</ul>
<div class = 'carousel-inner'>
";
for ($i = 1; $i <= count(glob("/img/ss/" . "*.jpg")); $i++) {
echo "<div class = 'carousel-item";
if ($i == 1) {
echo " active'><img src = '/img/ss/";
} else {
echo "'><img src = '/img/ss/";
}
echo "{$i}.jpg'></div>";
}
?>
</div>
<a class = 'carousel-control-prev' href = '#slide-show' data-slide = 'prev'>
<span class = 'carousel-control-prev-icon'></span>
</a>
<a class = 'carousel-control-next' href = '#slide-show' data-slide = 'next'>
<span class = 'carousel-control-next-icon'></span>
</a>
</div>