-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
43 lines (34 loc) · 1.04 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/style.css">
<link href="https://fonts.googleapis.com/css?family=Gloria+Hallelujah|Libre+Barcode+39+Text" rel="stylesheet">
</head>
<body>
<h1> our fancy pink freeCodeCamp slider</h1>
<div class="container">
<button class="w3-button w3-display-left" onclick="plusDivs(-1)">❮</button>
<img class="mySlides" src="img/one.jpg">
<img class="mySlides" src="img/two.jpg">
<img class="mySlides" src="img/three.jpg">
<button class="w3-button w3-display-right" onclick="plusDivs(+1)">❯</button>
</div>
<script>
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs(slideIndex += n);
}
function showDivs(n) {
var i;
var x = document.getElementsByClassName("mySlides");
if (n > x.length) {slideIndex = 1}
if (n < 1) {slideIndex = x.length} ;
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[slideIndex-1].style.display = "block";
}
</script>
</body>
</html>