Spaces:
Running
Running
// --------------------Podcast Tabs Functionality-------------------- | |
const podcastTabButtons = document.querySelectorAll('.podcast-tab-button'); | |
const podcastContents = document.querySelectorAll('.podcast-content'); | |
podcastTabButtons.forEach(button => { | |
button.addEventListener('click', () => { | |
// Remove active class from all buttons | |
podcastTabButtons.forEach(btn => btn.classList.remove('active')); | |
// Add active class to the clicked button | |
button.classList.add('active'); | |
// Hide all podcast content | |
podcastContents.forEach(content => { | |
content.classList.add('hidden'); | |
content.classList.remove('active'); | |
}); | |
// Show the selected podcast content | |
const target = button.getAttribute('data-podcast-tab'); | |
const targetContent = document.getElementById(target); | |
if (targetContent) { | |
targetContent.classList.remove('hidden'); | |
targetContent.classList.add('active'); | |
} | |
}); | |
}); | |