-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
37 lines (30 loc) · 1.09 KB
/
script.js
File metadata and controls
37 lines (30 loc) · 1.09 KB
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
/************************************************/
/********* ADD CHECKLIST FUNCTIONALITY **********/
/************************************************/
/*link to slide show maybe?*/
/*https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_slideshow_animated/
/* TODO: Add a variable to store the "my-list" element */
var fullItemList = document.getElementById("my-list");
/* TODO: Create the event listener that listens for a mouse click and runs the checkOffList function */
if (fullItemList) {
fullItemList.addEventListener("click", checkOffItem);
} // add event listener
/* TODO: Declare the function checkOffList and add actions inside the { } */
function checkOffItem(clicked) {
if (clicked.target.tagName == "LI") {
clicked.target.classList.toggle("all-done");
}
}
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 2500);
}