MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / setupScrollOptimization

Method setupScrollOptimization

src/js/performance.js:127–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125
126 // 滚动优化
127 setupScrollOptimization() {
128 let ticking = false;
129
130 const handleScroll = () => {
131 if (!ticking) {
132 requestAnimationFrame(() => {
133 this.updateScrollEffects();
134 ticking = false;
135 });
136 ticking = true;
137 }
138 };
139
140 window.addEventListener('scroll', handleScroll, { passive: true });
141 }
142
143 // 更新滚动效果(缓存DOM查询)
144 updateScrollEffects() {

Callers 1

initMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected