Scroll with Mouse Plus

Scroll a page by simply moving the cursor up and down, without even a click!

当前为 2022-02-09 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
hzhbest
评分
0 0 0
版本
1.18
创建于
2020-06-24
更新于
2022-02-09
大小
4.7 KB
许可证
GNU GPLv3
适用于
所有网站

Intro | 简介

From "Protector one"'s script "Scroll with the Mouse", I take the idea and do some modifications so that this script can do:

  • Free vertical scrolling without a click (original function);
  • Full simulation of scrollblock dragging (algorithm changed);
  • Works on all pages (compatibility improved, not available to textarea);
  • Allow wider scroll-sensitive zone (flexibility);
  • Optional semi-transparent indicator bar (turn off in the code as you like);
  • Continue scrolling in the free scrolling mode when cursor reaches the top or the bottom;
  • Click in the scroll-sensitive zone to deactivate.

启发自“Protector one”的脚本“Scroll with the Mouse”,我取用了其实现方式(代码)并添加了我自己的想法所作的修改,形成了这个脚本,它能够:

  • 自由的垂直滚动,完全无需点击(原功能);
  • 滚动效果与拖动滚动块滚动基本无异(改进的算法);
  • 对所有页面有效(改进的兼容性);
  • 鼠标指针可以在一个更宽的“滚动触发区”操控滚动(提高灵活性);
  • 半透明滚动提示条(可以在代码中设置是否显示);
  • 在“自由滚动模式”中鼠标指针在接近页面顶部或底部移动时页面会继续向上或向下滚动;
  • 在“滚动触发区”点击即可停止滚动。

INSTRUCTION | 使用方法

  1. Move the cursor into the vertical scrollbar(#1, #2) to activate the free scrolling mode;
  2. In the free scrolling mode just move the cursor up and down and the page will scroll according to your movement (just like dragging the scrollblock)(#3);
  3. An indicator bar will appear under the mouse to tell that you are in the free scrolling mode while showing the width of the scroll-sensitive zone;
  4. Keeping the cursor in the sensitive zone (by default 10% width of the display area on the right) you can scroll freely with only the movement of the cursor;
  5. To stop scrolling, just move the cursor left and out of the scroll-sensitive zone, or just left-click(#4), and the free scrolling mode will be deactivated, scrolling stops.

  1. 将鼠标指针移动到垂直滚动栏上(#1,#2),“自由滚动模式”就会激活;
  2. 激活“自由滚动模式”后即可自由上下移动鼠标以滚动页面,移动方式跟拖动滚动条一样(#3);
  3. 滚动提示条会在鼠标指针下显示,提示你在“自由滚动模式”中,其宽度就是“滚动触发区”的宽度;
  4. 只要鼠标指针保持在“滚动触发区”(这区域默认是显示面积的右10%)之内,就能通过自由移动鼠标指针滚动页面;
  5. 要停止滚动,只需要将鼠标向左移动到“滚动触发区”之外,或点击一下(#4),就会退出“自由滚动模式”,滚动也立即停止。

Notice | 须知

  • #1 The script does not interact with scrollbars of textarea, dropdown-list etc., as well as non-webpage documents, eg. image, text file, etc.
  • #2 In order to prevent accidental activation, the script offer two options to add preconditions activating the free scrolling mode: pressing Ctrl key when moving onto the scrollbar; move on the scrollbar within the middle 100px (e.g. up and down 50px near the half-height line) of the window area.
  • #3 Scrolling with Ctrl key pressed will let the page scroll in half speed, therefore you would get better control on long pages, or just to enjoy slow reading/viewing.
  • #4 When you click to deactivate the free scrolling mode with indicator bar hidden, be careful not to click on any click-able object to prevent misoperation.

  • #1 该脚本对文本区域、下拉列表等网页元素的滚动条无效;对非页面文件的文件窗口,如单纯图片、文本文件窗口无效(GM限制)。
  • #2 为避免误操作,该脚本额外提供两种移到滚动栏上激活“自由滚动模式”的先决条件:按住 Ctrl 键 和 在窗口中间100像素范围内(即显示范围水平中线上下各50像素范围)。
  • #3 在“自由滚动模式”中按住 Ctrl 键可以用半速滚动,用于超长的网页,或只是想滚动得慢点。
  • #4 如果提示条设为隐藏,在你要点击退出“自由滚动模式”时,请注意不要点到页面上可点击的对象,以免造成误操作。(或者请使用向左移动鼠标指针的方式退出。)

Other | 其他

The original script by Protector one:|原始脚本位置:
https://userscripts-mirror.org/scripts/show/63593

If you prefer all-direction slow scrolling:|我推荐的全方向(慢)滚动脚本:
(NOT Compatible with this script)|(同我的脚本无法共用)
https://userscripts-mirror.org/scripts/show/47788

UPDATE LOG | 更新记录

20091229|1.04 Add function: click to deactivate.|增加功能:点击退出“自由滚动模式”。
20091229|1.05 Not making the indicator bar when not activated.|不再提早生成提示条,避免在 HTML 编辑器中留下不必要的痕迹。
20091230 1.10 Add function: while the free scrolling mode active, keep moving the cursor near the top or bottom of the page will continue scroll the page up or down; all customizable variables are separated for easy code editing to customize.| 增加功能:激活“自由滚动模式”后鼠标指针在接近页面顶部或底部移动时页面会继续向上或向下滚动;可自定义变量都分离出来放在代码开头,便于编辑。
20091230|1.11 Abandon the method with which the original script used to determine page scroll height, instead I use the more accurate innerHeight, now the script can do it right in short pages; fix the code that would cause GreaseMonkey generates a long error log (through invisible to users).| 放弃原脚本的方法,用 innerHeight 判断页面显示高度,使得在短页面脚本不会被激活;修复一个小错误。
20091230|1.12 Abandon the method with which the original script used to determine page scroll width, instead I use the method similar to my method to improve compatibility; abandon text on the indicator bar, instead I use cursor. | 放弃原脚本的方法,用相似于我用来提高兼容性的方法判断页面显示宽度,使得在有额外空隙的页面脚本能正确判断“滚动栏的位置”;放弃在提示条上显示文本,使用鼠标效果取而代之。
20091230|1.13 Disable on editable page (contentEditable="true").| 不对可编辑的页面起作用,例如“所见即所得”的网页编辑器。
20091231|1.14 Add indicator bar height to customizable zone; algorithm changed to improve accuracy in long page.| 增加调整提示条粗细的自定义项;更新算法使长页面的滚动准确跟上鼠标移动。
20100105|1.15 Algorithm change: if you provide the correct width of scrollbar, you will have accurate scrolling.| 算法更新:在代码中指定位置填入正确的滚动条宽度的话,将可以做到与拖动滚动块完全无异。
20100112|1.16 Add optional condition to activate free scroll mode; add function to press Ctrl for half scroll speed.| 增加激活“自由滚动区”的条件(可选);增加(激活后)按住 Ctrl 键半速滚动。
20200624|1.17 Add compatibility setting to run on new version of GM; add exception to editable page.| 增加对新版油猴的兼容设置;增加排除可编辑页面的语句。

一些说明

本来这脚本只是我放在Userscript.org上,一直更新到十年前的1.16版,然后就忙于工作,基本上很少维护自己的脚本,也很少关注Firefox相关的信息。一次偶然的机会,使用了一个网友的“美化增强版”Firefox新版本,在里面发现了两个我的(严格来说是改进过的)脚本,Ewh和这个。我自己也很久没用这个脚本,于是带着怀念青春的想法用了一下,并且鬼使神差(或者说习惯使然)地打开了其代码,发现里面的作者赫然写着别人的名字,版本号也去到1.50,但是凭着我当年一直维护这脚本的记忆我分明看出了这脚本绝大部分代码都是我的!我拿这脚本的名称在搜索引擎上搜,因为Userscript.org已经关闭了,镜像站Userscript-mirror.org在搜索引擎上排名也不高,排在前面的就是这个同名脚本的作者发布页。通过深度搜索,我没发现同名脚本的其他版本,认定该作者是唯一发布同名脚本的作者。作者总共有三个存放点,一个是本站,一个是github,还有一个(略);在我在本站上发信要求对方补充脚本说明和原作者声明之后,作者选择第一时间删除了前两个存放点,一干二净,但第三个存放点至2020-6-24仍然能下载。我的诉求依然如故,希望他发布的脚本能在发布页面补充脚本说明和原作者声明而已。
放在本站,算是为大家提供“正版”的脚本。
另外,那个同名脚本加了个为手机版Firefox添加返回到页顶的按钮。我认为这跟鼠标滚动的功能并不相关,所以我没将这些代码添加进来。

需要这个功能的,可以使用同站的一个脚本:
For those who need a button to scroll to the top / the bottom of a webpage, there is another script for you:
https://greasyfork.org/zh-CN/scripts/370556-%E4%B8%80%E4%B8%AA%E8%BF%94%E5%9B%9E%E9%A1%B6%E9%83%A8%E5%92%8C%E5%88%B0%E8%BE%BE%E5%BA%95%E9%83%A8%E7%9A%84%E6%8C%89%E9%92%AE