Skip to content

Commit

Permalink
faq-toggle-update (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
venktesh0755 authored Jul 18, 2024
1 parent 668d8b0 commit 1ea5c3e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,24 @@ <h1>FAQ</h1>
<a class="gotopbtn" href="javascript:void(0);"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
</div>
<script>
// Scroll to top button
document.addEventListener('DOMContentLoaded', function() {
const faqToggles = document.querySelectorAll('.faq-toggle');

faqToggles.forEach(toggle => {
toggle.addEventListener('change', function() {
if (this.checked) {
// Close all other FAQ items
faqToggles.forEach(otherToggle => {
if (otherToggle !== this) {
otherToggle.checked = false;
}
});
}
});
});
});

// Keep the existing scroll to top button functionality
const topButton = document.querySelector('.gotopbtn');
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
Expand Down

0 comments on commit 1ea5c3e

Please sign in to comment.