Files
satware.ai/docs/assets/javascript/faq.js
T
tfw 452455fe21 Update assets and sitemap, remove obsolete icons and fonts
Reorganized font and image assets, replacing outdated files with new ones. Removed unused SVG icons and updated the sitemap with new URLs and last modified dates. Simplified font-face declarations to reflect the updated font structure.
2025-05-06 16:28:26 +02:00

36 lines
1.3 KiB
JavaScript

document.addEventListener('DOMContentLoaded', function() {
// Finde alle FAQ-Fragen
const faqQuestions = document.querySelectorAll('.custom-faq-question');
if (faqQuestions.length === 0) {
console.log('Keine benutzerdefinierten FAQ-Elemente gefunden');
return;
}
console.log('Benutzerdefinierte FAQ-Elemente gefunden:', faqQuestions.length);
// Füge Event-Listener zu jeder Frage hinzu
faqQuestions.forEach(question => {
question.addEventListener('click', function() {
// Toggle active class auf der Frage
this.classList.toggle('active');
// Toggle active class auf der Antwort
const answer = this.nextElementSibling;
answer.classList.toggle('active');
// Wenn diese Frage geöffnet wurde, schließe alle anderen
if (this.classList.contains('active')) {
faqQuestions.forEach(otherQuestion => {
if (otherQuestion !== this && otherQuestion.classList.contains('active')) {
otherQuestion.classList.remove('active');
otherQuestion.nextElementSibling.classList.remove('active');
}
});
}
});
});
console.log('Benutzerdefinierte FAQ-Funktionalität initialisiert');
});