-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
26 lines (23 loc) · 714 Bytes
/
Copy pathmain.js
File metadata and controls
26 lines (23 loc) · 714 Bytes
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
const popup = document.querySelector(".popup");
const close = document.querySelector(".close");
window.onload = function () {
setTimeout(function () {
popup.style.display = "block";
}, 500);
};
close.addEventListener("click", () => {
popup.style.display = "none";
});
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function () {
this.classList.toggle("active");
var collapsecontent = this.nextElementSibling;
if (collapsecontent.style.maxHeight) {
collapsecontent.style.maxHeight = null;
} else {
collapsecontent.style.maxHeight = collapsecontent.scrollHeight + "px";
}
});
}