Updated js
#1
by
pranshh
- opened
- static/index.js +11 -0
static/index.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
| 1 |
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
console.log('Landing page loaded.');
|
| 3 |
|
| 4 |
// Animate elements on scroll using Intersection Observer
|
|
|
|
| 1 |
document.addEventListener('DOMContentLoaded', () => {
|
| 2 |
+
// FIX: Ensure main navigation links work correctly
|
| 3 |
+
const navLinks = document.querySelectorAll('header nav a');
|
| 4 |
+
navLinks.forEach(link => {
|
| 5 |
+
link.addEventListener('click', function(event) {
|
| 6 |
+
// Stop any other script from interfering
|
| 7 |
+
event.stopImmediatePropagation();
|
| 8 |
+
// Manually navigate to the link's href
|
| 9 |
+
window.location.href = this.href;
|
| 10 |
+
}, true); // Use capture phase to make sure this runs first
|
| 11 |
+
});
|
| 12 |
+
|
| 13 |
console.log('Landing page loaded.');
|
| 14 |
|
| 15 |
// Animate elements on scroll using Intersection Observer
|