Skip to content

Commit 6ef2f8f

Browse files
committed
Update event.md
1 parent d377c2d commit 6ef2f8f

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

_pages/event.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -347,34 +347,40 @@ document.addEventListener('DOMContentLoaded', function() {
347347

348348
// Speaker details functionality
349349
function showSpeakerDetails(speakerId) {
350-
// Hide all details
351-
document.querySelectorAll('.speaker-details').forEach(detail => {
352-
detail.classList.remove('show');
353-
detail.style.display = 'none';
354-
});
355-
356-
// Remove active states
357-
document.querySelectorAll('.custom-card').forEach(card => {
358-
card.classList.remove('active');
359-
});
350+
try {
351+
// Hide all details first
352+
document.querySelectorAll('.speaker-details').forEach(detail => {
353+
detail.classList.remove('show');
354+
detail.style.display = 'none';
355+
});
356+
357+
// Remove active states
358+
document.querySelectorAll('.custom-card').forEach(card => {
359+
card.classList.remove('active');
360+
});
361+
362+
// Show selected speaker
363+
const speakerDetails = document.getElementById(`speaker-details-${speakerId}`);
364+
const speakerCard = document.querySelector(`.custom-card[data-speaker-id="${speakerId}"]`);
365+
366+
if (!speakerDetails || !speakerCard) {
367+
console.warn(`Speaker with ID ${speakerId} not found`);
368+
return;
369+
}
360370

361-
// Show selected speaker
362-
const speakerDetails = document.getElementById(`speaker-details-${speakerId}`);
363-
const speakerCard = document.querySelector(`.custom-card[data-speaker-id="${speakerId}"]`);
364-
365-
if (speakerDetails && speakerCard) {
366371
speakerCard.classList.add('active');
367372
speakerDetails.classList.add('show');
368373
speakerDetails.style.display = 'block';
369374

370-
// Smooth scroll with delay for animation
371375
setTimeout(() => {
372376
const offset = speakerDetails.offsetTop;
373377
window.scrollTo({
374378
top: offset - 80,
375379
behavior: 'smooth'
376380
});
377381
}, 100);
382+
} catch (error) {
383+
console.error('Error showing speaker details:', error);
378384
}
379385
}
380386

0 commit comments

Comments
 (0)