Greasy Fork is available in English.
双击左上角的椭圆,开始屏幕向下滑动,可自定义速度,速度范围-10~10(默认速度为1)。双击滑动开始或停止。上下键实时调速度。
当前为
// ==UserScript== // @name 双击网页自动滑动,自动阅读 // @namespace https://github.com/zhchjiang95 // @version 0.1.3 // @description 双击左上角的椭圆,开始屏幕向下滑动,可自定义速度,速度范围-10~10(默认速度为1)。双击滑动开始或停止。上下键实时调速度。 // @author zhchjiang95 <[email protected]> // @include http://* // @include https://* // @require https://code.jquery.com/jquery-3.3.1.min.js // @match http://* // @match https://* // @grant none // ==/UserScript== var box = $('<div class="move-box" title="双击开始(停止)自动滚动页面"><input type="number" class="move-val" value="1" /></div>'); $('body').append(box); (function(){ $('.move-box').css({ 'width': '40px', 'height': '30px', 'position': 'fixed', 'top': '80px', 'left': '10px', 'z-index': 99999999 }); $('.move-val').css({ 'width': 'inherit', 'height': 'inherit', 'color': '#ffffff', 'background': 'orange', 'opacity': 0.3, 'border': 'none', 'outline': 'none', 'border-radius': '50%', 'font-size': '18px', 'text-align': 'center' }) }()) var elinput = document.getElementsByClassName('move-val')[0], speed = 1, timer = null, isMove = false; elinput.oninput = function(){ if(this.value > 10){ this.value = 10; } if(this.value < -10){ this.value = -10; } if(this.value == ''){ this.value = 0; } speed = Number(this.value); } elinput.ondblclick = function(){ if(isMove){ clearInterval(timer); isMove = false; }else{ timer = setInterval(move,20); isMove = true; } } function move(){ window.scrollBy(0,speed); if($(window).height()+$(window).scrollTop()>=$(document).height()-2 || $(window).scrollTop() == 0){ clearInterval(timer); isMove = false; } }