更新
This commit is contained in:
parent
3553ffb80c
commit
9797185091
@ -536,11 +536,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
};
|
||||
let Y = window.pageYOffset;
|
||||
handleHeader(Y);
|
||||
let _debounce = null;
|
||||
$(document).on('scroll', function () {
|
||||
clearTimeout(_debounce);
|
||||
_debounce = setTimeout(() => {
|
||||
const diffY = Y - window.pageYOffset;
|
||||
if (window.requestAnimationFrame) requestAnimationFrame(handleHeader.bind(null, diffY));
|
||||
else handleHeader(diffY);
|
||||
handleHeader(diffY);
|
||||
Y = window.pageYOffset;
|
||||
}, 15);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
2
assets/js/joe.global.min.js
vendored
2
assets/js/joe.global.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user