AutoScroll1234

AutoScroll-自动滚屏

当前为 2021-06-23 提交的版本,查看 最新版本

// ==UserScript==
// @name        AutoScroll1234
// @namespace   
// @description AutoScroll-自动滚屏
// @include     http*
// @version     2016.03.07.01
// @author      nosura
// @grant       none
// ==/UserScript==

(() => {
  let direction = -1;
  let height = 0;
  setInterval(() => {
    let {scrollY} = window;
    if(scrollY === 0){
      height++;
      direction =- 1;
    }
    if (scrollY > direction ){
      height++;
    } else {
      height--;
    }
    window.scroll(0,height);
    direction = scrollY;
  }, 20);
})()