More actions
No edit summary |
No edit summary |
||
| Line 42: | Line 42: | ||
} | } | ||
// | // Step 1: Find the nearest citizen-section-heading | ||
const sectionHeading = heading.closest('.citizen-section-heading'); | |||
// | if (sectionHeading) { | ||
// Step 2: Find the .citizen-section content that follows it | |||
content = | const content = sectionHeading.nextElementSibling; | ||
if (content && content.classList.contains('citizen-section') && content.hidden) { | |||
content.hidden = false; // Expand the real content div | |||
} | |||
} | } | ||
// | // Step 3: Smooth scroll to the heading itself | ||
setTimeout(() => { | setTimeout(() => { | ||
heading.scrollIntoView({ behavior: 'smooth', block: 'start' }); | heading.scrollIntoView({ behavior: 'smooth', block: 'start' }); | ||