-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (20 loc) · 688 Bytes
/
script.js
File metadata and controls
24 lines (20 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// script.js
// Functionality for website navigation
function navigateTo(section) {
const sections = document.querySelectorAll('.section');
sections.forEach(sec => {
sec.style.display = 'none';
});
document.querySelector(`#${section}`).style.display = 'block';
}
// Event listeners for navigation
document.querySelectorAll('.nav-link').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const targetSection = e.target.getAttribute('data-target');
navigateTo(targetSection);
});
});
// Initial setup
navigateTo('home'); // Show home section by default
// Add more interactivity functionality as needed.