digitalhuman / podcast.js
atlury's picture
Upload 19 files
888c52f verified
raw
history blame contribute delete
953 Bytes
// --------------------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');
}
});
});