Yacine Jernite
commited on
Commit
·
63f3b21
1
Parent(s):
6519bad
fix sticky nav at launch
Browse files
js/utils/stickyNavigation.js
CHANGED
|
@@ -21,7 +21,7 @@ export function initializeStickyNavigation(navElementId) {
|
|
| 21 |
// Calculate sticky threshold: when nav reaches bottom of header plus padding
|
| 22 |
const headerHeight = parseInt(getComputedStyle(document.documentElement)
|
| 23 |
.getPropertyValue('--header-height')) || 100;
|
| 24 |
-
const stickyThreshold = navSection.offsetTop - headerHeight +
|
| 25 |
|
| 26 |
// Scroll handler with throttling
|
| 27 |
let scrollTimeout;
|
|
|
|
| 21 |
// Calculate sticky threshold: when nav reaches bottom of header plus padding
|
| 22 |
const headerHeight = parseInt(getComputedStyle(document.documentElement)
|
| 23 |
.getPropertyValue('--header-height')) || 100;
|
| 24 |
+
const stickyThreshold = navSection.offsetTop - headerHeight + 60; // 60px padding
|
| 25 |
|
| 26 |
// Scroll handler with throttling
|
| 27 |
let scrollTimeout;
|