|
@@ -92,9 +92,15 @@ export default class App {
|
92
|
92
|
}
|
93
|
93
|
|
94
|
94
|
});
|
95
|
|
- console.log(scrollY,ulScrolls);
|
|
95
|
+ let documentHeight = document.documentElement.scrollHeight; // 文档总高度
|
|
96
|
+ let viewportHeight = window.innerHeight; // 视口高度
|
|
97
|
+ const heightThreshold = documentHeight - viewportHeight - 249; // 计算阈值
|
|
98
|
+ let dom = document.querySelector('.timeYear')
|
|
99
|
+ dom.style.opacity = (scrollY >= heightThreshold) ? '0' : '1';
|
|
100
|
+
|
|
101
|
+ // console.log(scrollY,ulScrolls);
|
96
|
102
|
|
97
|
|
- } catch (error) { }
|
|
103
|
+ } catch (error) { console.log(error)}
|
98
|
104
|
}
|
99
|
105
|
window.addEventListener('scroll', updateScrollChange1);
|
100
|
106
|
}
|