Skip to content

Commit

Permalink
quiz link added
Browse files Browse the repository at this point in the history
  • Loading branch information
akash70629 committed Nov 10, 2024
1 parent 1bdb1bc commit 476eb67
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
20 changes: 18 additions & 2 deletions assets/js/faq.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ document.addEventListener("DOMContentLoaded", function () {
const icon = container.querySelector(".icon");
const answers = container.querySelector(".answers");

container.addEventListener("click", () => {
container.addEventListener("click", (event) => {
// Prevent the click event from bubbling up to the document
event.stopPropagation();

if (icon.classList.contains("active")) {
icon.classList.remove("active");
answers.style.maxHeight = null;
Expand All @@ -15,4 +18,17 @@ document.addEventListener("DOMContentLoaded", function () {
}
});
});
});

// Close all FAQs when clicking outside
document.addEventListener("click", () => {
faqContainers.forEach((container) => {
const icon = container.querySelector(".icon");
const answers = container.querySelector(".answers");

if (icon.classList.contains("active")) {
icon.classList.remove("active");
answers.style.maxHeight = null;
}
});
});
});
7 changes: 7 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6959,6 +6959,13 @@ <h4 class="flinks">Blogs</h4>
</a></li>
</ul>
</div>
<div>
<ul>
<li class="foot-quick"><a href="assets/html/bookpref.html"><i class="fas fa-book"></i>
<h4 class="flinks">Book Quiz</h4>
</a></li>
</ul>
</div>

</div>

Expand Down

0 comments on commit 476eb67

Please sign in to comment.