-
Notifications
You must be signed in to change notification settings - Fork 3
/
script.js
31 lines (25 loc) · 907 Bytes
/
script.js
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
const faqBoxes = document.querySelectorAll('.faq-box');
faqBoxes.forEach(faqBox => {
faqBox.addEventListener('click', () => {
// Toggle the active class on the current faq-box
faqBox.classList.toggle('active');
// Remove the active class from all other faq-boxes
faqBoxes.forEach(otherFaqBox => {
if (otherFaqBox !== faqBox) {
otherFaqBox.classList.remove('active');
}
});
// Scroll the previous active faq-box up
const previouslyActiveFaqBox = Array.from(faqBoxes).find(faq => faq.classList.contains('active') && faq !== faqBox);
if (previouslyActiveFaqBox) {
previouslyActiveFaqBox.scrollIntoView({ behavior: 'smooth' });
}
});
});
var loaderElement = document.getElementById("loader");
// function hideLoader() {
// loaderElement.style.display = "none";
// }
setTimeout(function() {
loaderElement.style.display="none";
},5000);