MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / initScrollBehavior

Function initScrollBehavior

docs/javascripts/header-scroll.js:50–64  ·  view source on GitHub ↗

* Initialize scroll behavior

()

Source from the content-addressed store, hash-verified

48 * Initialize scroll behavior
49 */
50 function initScrollBehavior() {
51 // Add scroll event listener
52 window.addEventListener('scroll', handleScroll, { passive: true });
53
54 // Handle initial scroll position
55 handleScroll();
56
57 // Handle page navigation (for SPA-like behavior in Material)
58 document.addEventListener('DOMContentLoaded', handleScroll);
59
60 // Handle instant navigation if enabled
61 if (typeof app !== 'undefined' && app.location$) {
62 app.location$.subscribe(handleScroll);
63 }
64 }
65
66 /**
67 * Cleanup function

Callers 1

header-scroll.jsFile · 0.85

Calls 1

handleScrollFunction · 0.85

Tested by

no test coverage detected