更新
This commit is contained in:
parent
3553ffb80c
commit
9797185091
@ -536,11 +536,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
};
|
};
|
||||||
let Y = window.pageYOffset;
|
let Y = window.pageYOffset;
|
||||||
handleHeader(Y);
|
handleHeader(Y);
|
||||||
|
let _debounce = null;
|
||||||
$(document).on('scroll', function () {
|
$(document).on('scroll', function () {
|
||||||
|
clearTimeout(_debounce);
|
||||||
|
_debounce = setTimeout(() => {
|
||||||
const diffY = Y - window.pageYOffset;
|
const diffY = Y - window.pageYOffset;
|
||||||
if (window.requestAnimationFrame) requestAnimationFrame(handleHeader.bind(null, diffY));
|
handleHeader(diffY);
|
||||||
else handleHeader(diffY);
|
|
||||||
Y = window.pageYOffset;
|
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