diff --git a/news.html b/news.html index 12063f5..44ffe1d 100644 --- a/news.html +++ b/news.html @@ -301,11 +301,14 @@ // Close ALL other story cards globally across all categories const allCards = document.querySelectorAll('.story-card'); allCards.forEach(c => { - if (c !== card) { + if (c !== card && c.classList.contains('open')) { c.classList.remove('open'); const b = c.querySelector('.story-body'); if (b) { + b.style.transition = 'none'; b.style.maxHeight = '0px'; + b.offsetHeight; // Force reflow + b.style.transition = ''; // Restore transition for next open } } }); @@ -318,7 +321,7 @@ // Smoothly scroll the newly opened story card to the top of the viewport setTimeout(() => { card.scrollIntoView({ behavior: 'smooth', block: 'start' }); - }, 100); + }, 50); // Small delay to allow reflow, works perfectly and instantly } else { card.classList.remove('open'); if (body) {