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);
};

  

相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2021-07-31
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
猜你喜欢
  • 2022-03-04
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
相关资源
相似解决方案