Merge pull request #1075 from EmptyDreams/patch-1

修正`throttle`函数调用方式
pull/1087/head
Jerry Wong 2 years ago committed by GitHub
commit bf3a43e62a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -277,8 +277,7 @@ document.addEventListener('DOMContentLoaded', function () {
const isChatBtnHide = typeof chatBtnHide === 'function'
const isChatBtnShow = typeof chatBtnShow === 'function'
window.scrollCollect = () => {
return btf.throttle(function (e) {
const scrollTask = btf.throttle(() => {
const currentTop = window.scrollY || document.documentElement.scrollTop
const isDown = scrollDirection(currentTop)
if (currentTop > 56) {
@ -309,8 +308,9 @@ document.addEventListener('DOMContentLoaded', function () {
if (document.body.scrollHeight <= innerHeight) {
$rightside.style.cssText = 'opacity: 0.8; transform: translateX(-58px)'
}
}, 200)()
}
}, 200)
window.scrollCollect = scrollTask
window.addEventListener('scroll', scrollCollect)
}

Loading…
Cancel
Save