Mobile optimizacija in ostale spremembe
Deploy to Development and Production / deploy (push) Successful in 7s
Deploy to Development and Production / deploy (push) Successful in 7s
This commit is contained in:
1 parent
67f1a6b02c
commit
804d17319d
11 files changed
+1710
-236
No files matched your search
+20
-8
@@ -228,20 +228,32 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const accordions = document.querySelectorAll('.accordion-toggle');
|
||||
accordions.forEach(accordion => {
|
||||
accordion.addEventListener('click', function() {
|
||||
this.classList.toggle('active');
|
||||
const content = this.nextElementSibling;
|
||||
const accordionItem = this.closest('.mediation-accordion-item');
|
||||
const content = accordionItem ? accordionItem.querySelector('.accordion-content') : null;
|
||||
|
||||
if (content.style.maxHeight) {
|
||||
// Če je odprto, zapri
|
||||
content.style.maxHeight = null;
|
||||
this.textContent = 'Več';
|
||||
} else {
|
||||
// Če je zaprto, odpri
|
||||
if (!content) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.classList.toggle('active');
|
||||
const isOpen = this.classList.contains('active');
|
||||
this.setAttribute('aria-expanded', String(isOpen));
|
||||
content.setAttribute('aria-hidden', String(!isOpen));
|
||||
|
||||
if (isOpen) {
|
||||
content.style.maxHeight = content.scrollHeight + "px";
|
||||
this.textContent = 'Manj';
|
||||
} else {
|
||||
content.style.maxHeight = null;
|
||||
this.textContent = 'Več';
|
||||
}
|
||||
});
|
||||
accordion.textContent = 'Več';
|
||||
accordion.setAttribute('aria-expanded', 'false');
|
||||
const initialContent = accordion.closest('.mediation-accordion-item')?.querySelector('.accordion-content');
|
||||
if (initialContent) {
|
||||
initialContent.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
});
|
||||
|
||||
// --- Header Scroll Effect ---
|
||||
|
||||
Reference in new issue
Block a user