We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c159d93 commit 8b34db8Copy full SHA for 8b34db8
packages/frontendmu-nuxt/components/site/Menu.vue
@@ -140,7 +140,16 @@ function toggleHeader() {
140
lastScrollPosition = currentScrollPosition;
141
};
142
143
- window.addEventListener("scroll", handleScroll);
+ const observer = new IntersectionObserver(
144
+ ([entry]) => {
145
+ if (entry.isIntersecting) {
146
+ window.addEventListener("scroll", handleScroll, { passive: true });
147
+ }
148
+ },
149
+ { threshold: 0 }
150
+ );
151
+
152
+ observer.observe($header);
153
}
154
155
0 commit comments