更新
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 () {
|
||||||
const diffY = Y - window.pageYOffset;
|
clearTimeout(_debounce);
|
||||||
if (window.requestAnimationFrame) requestAnimationFrame(handleHeader.bind(null, diffY));
|
_debounce = setTimeout(() => {
|
||||||
else handleHeader(diffY);
|
const diffY = Y - window.pageYOffset;
|
||||||
Y = window.pageYOffset;
|
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