// 滚动穿透  true为背景滚动禁用
StopBodyScroll (isFixed) {
try {
const bodyEl = document.body;
if (isFixed) {
this.top = window.scrollY
bodyEl.style.position = 'fixed'
bodyEl.style.top = -this.top + 'px'
} else {
bodyEl.style.position = ''
bodyEl.style.top = ''
window.scrollTo(0, this.top) // 回到原先的top
}

} catch (err) {
console.log(err);
}
},
posted on 2022-06-21 12:01  仔仔爱学习  阅读(141)  评论(0编辑  收藏  举报