-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
22 lines (21 loc) · 870 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Accordion
const accordionItemHeaders = document.querySelectorAll(".accordion-item-header");
accordionItemHeaders.forEach(accordionItemHeader => {
accordionItemHeader.addEventListener("click", event =>{
accordionItemHeader.classList.toggle("active");
const accordionItemBody = accordionItemHeader.nextElementSibling;
if(accordionItemHeader.classList.contains("active")){
accordionItemBody.style.maxHeight = accordionItemBody.scrollHeight + "px";
}
else{
accordionItemBody.style.maxHeight = 0;
}
});
});
// Clarity
document.getElementById("button").addEventListener("click", function(){
document.querySelector(".popup").style.display = "flex";
})
document.querySelector(".fa-xmark").addEventListener("click", function(){
document.querySelector(".popup").style.display = "none";
})