Update static/index.js

#4
by pranshh - opened
Files changed (1) hide show
  1. static/index.js +8 -0
static/index.js CHANGED
@@ -1,4 +1,12 @@
1
  document.addEventListener('DOMContentLoaded', () => {
 
 
 
 
 
 
 
 
2
  console.log('Landing page loaded.');
3
 
4
  // Animate elements on scroll using Intersection Observer
 
1
  document.addEventListener('DOMContentLoaded', () => {
2
+ const navLinks = document.querySelectorAll('header nav a');
3
+ navLinks.forEach(link => {
4
+ link.addEventListener('click', function(event) {
5
+ event.stopImmediatePropagation();
6
+ window.location.href = this.href;
7
+ }, true);
8
+ });
9
+
10
  console.log('Landing page loaded.');
11
 
12
  // Animate elements on scroll using Intersection Observer