hangleGoUp(){
console.log("开始")
let nowTop = document.body.scrollTop || document.documentElement.scrollTop; // 获取当前滚动条位置
if (nowTop > 0) {
window.requestAnimationFrame(this.hangleGoUp);
window.scrollTo (0,nowTop - (nowTop/50));
}
console.log("结尾")
}
原文地址:https://www.cnblogs.com/supereast/p/11703226.html
时间: 2024-11-16 04:06:04