Files
Student-Management-System-I…/static/js/hod/utils/navigation.js
T
2025-04-20 17:46:30 +05:45

24 lines
713 B
JavaScript

// Function to show a specific section
function showSection(sectionId) {
// Hide all sections
document.querySelectorAll('.content-section').forEach(section => {
section.style.display = 'none';
});
// Show selected section
const targetSection = document.getElementById(sectionId);
if (targetSection) {
targetSection.style.display = 'block';
}
// Update active nav item
document.querySelectorAll('.nav-item').forEach(item => {
item.classList.remove('active');
if (item.getAttribute('data-section') === sectionId.replace('Section', '')) {
item.classList.add('active');
}
});
}
// Export functions
export { showSection };