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.
36 lines
1.3 KiB
JavaScript
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');
|
|
});
|