标签:script == let element interval int val class tin
let backToTop = function() { let scrollToptimer = setInterval(function() { let top = document.body.scrollTop || document.documentElement.scrollTop; let speed = top / 4; if (document.body.scrollTop !== 0) { document.body.scrollTop -= speed; } else { document.documentElement.scrollTop -= speed; } if (top === 0) { clearInterval(scrollToptimer); } }, 40); };
标签:script == let element interval int val class tin
原文地址:https://www.cnblogs.com/webSong/p/10120633.html