mirror of
https://github.com/Sea-Haven-Industries/seahaven-site.git
synced 2026-10-03 02:13:16 +00:00
Add accordion toggle script for social accountability page
The ElementsKit accordion JS was removed during plugin cleanup. Added lightweight inline script to handle expand/collapse behavior for the accordion panels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ccbc29c06b
commit
d7a828f32e
1 changed files with 32 additions and 0 deletions
|
|
@ -972,6 +972,38 @@
|
|||
document.querySelectorAll('.elementor-counter-number').forEach(function(el){cio.observe(el)});
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
(function(){
|
||||
document.querySelectorAll('[data-ekit-toggle="collapse"]').forEach(function(btn){
|
||||
btn.addEventListener('click', function(e){
|
||||
e.preventDefault();
|
||||
var target = document.querySelector(btn.getAttribute('data-target'));
|
||||
if(!target) return;
|
||||
var isOpen = target.classList.contains('show');
|
||||
// Close all siblings in same accordion
|
||||
var parent = target.closest('.elementskit-accordion');
|
||||
if(parent){
|
||||
parent.querySelectorAll('.collapse.in').forEach(function(el){
|
||||
el.classList.remove('show');
|
||||
var t = el.closest('.elementskit-card');
|
||||
if(t){
|
||||
var a = t.querySelector('.elementskit-btn-link');
|
||||
if(a){ a.classList.add('collapsed'); a.setAttribute('aria-expanded','false'); }
|
||||
t.classList.remove('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
if(!isOpen){
|
||||
target.classList.add('show');
|
||||
btn.classList.remove('collapsed');
|
||||
btn.setAttribute('aria-expanded','true');
|
||||
var card = btn.closest('.elementskit-card');
|
||||
if(card) card.classList.add('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
<!-- Page supported by LiteSpeed Cache 6.5.4 on 2025-07-14 23:00:00 -->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue