fixed 弹幕修复 bug
This commit is contained in:
1 parent
a4c74cbb0d
commit
0714b8eb48
11 files changed
+446
-139
No files matched your search
@@ -58,11 +58,16 @@ window.initFloatingTools = function() {
|
||||
// Global Scroll Handler (Singleton)
|
||||
if (!window.backToTopScrollHandler) {
|
||||
window.backToTopScrollHandler = function() {
|
||||
// Performance Optimization: Check scroll less frequently?
|
||||
// No, rAF is best. But we can add a check if the button is even in DOM/Visible?
|
||||
// But checking DOM layout is expensive.
|
||||
// Keep rAF but ensure 'update' is light.
|
||||
if (!ticking) {
|
||||
window.requestAnimationFrame(update);
|
||||
ticking = true;
|
||||
}
|
||||
};
|
||||
// Use passive listener to prevent scroll blocking
|
||||
window.addEventListener('scroll', window.backToTopScrollHandler, { passive: true });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user