scroll - 减少网站上鼠标每个滚轮槽口的行数

标签 scroll mouse webpage mousewheel

我知道我们可以在 Windows 中通过控制面板-->鼠标-->滚轮-->减少/增加线数每个槽口轮来完成。但是,如果我需要在我的网站上做那件事怎么办。我想知道这种可能性。我们能否更改鼠标滚轮在网站 中滚动的行数,这样即使有人打开我的网站,即使他的窗口设置已保存为每行 3 行缺口,他在我的网站上每缺口体验 1 行……如果可能的话,怎么办?提前致谢..!!! ♥

编辑:问题的基线是平滑我网站的滚动“不是通过浏览器或操作系统中的自定义设置”,而是直接从服务器端通过一些编码和东西......

最佳答案

答案是:你不应该那样做。

您实际上要求的是一种无需任何许可即可通过任何站点更改高度敏感的系统设置的方法。这似乎很荒谬。简单地想象一下每个网站都有自己的“每个槽口轮的行数”设置。听起来对任何人来说都是 hell 。

顺便说一句,从可用性的角度来看,这是非常糟糕的方法。无论如何,正如您已经提到的,这可以在系统级别或浏览器级别完成。例如:

How can i change the number of jumped lines when scrolling?

For the first part of your question concerning scrolling with the mouse. By default Firefox will uses system settings for deciding how many lines to scroll when using the mouse wheel, but you can change it by modifying a couple of hidden preferences.

  • Type about:config into the location bar and press enter
  • Accept the warning message that appears and a list of preferences will appear
  • In the filter box type numlines
  • Double-click on the preference mousewheel.withnokey.sysnumlines to change its value to false
  • Double-click on the preference mousewheel.withnokey.numlines and change it to the number of lines you want to scroll

任何具有从外部静默更改系统设置选项的浏览器都将被删除。

您实际上可以做什么

当您且只有您负责渲染时,您可以控制所有鼠标特定参数。这意味着您可以使用 HTML Canvas 做任何您想做的事情。

一些有用的例子:

关于scroll - 减少网站上鼠标每个滚轮槽口的行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18124676/

相关文章:

html - 如何将滚动菜单栏更改为稳定菜单栏?

html - 一个特定页面上 15 px 的奇怪右滚动 - css 问题

javascript - p5.j​​s 的鼠标变量可以在触摸屏设备上使用吗? (JavaScript)

java - 事件多次触发 - LWJGL

javascript - 如何知道我是从网络还是移动设备访问 html 页面

javascript - 为什么 fbevents.js 加载到我的页面上?

网页底部/顶部的 JavaScript?

c# - RichTextBox 滚动到结束

javascript - jscrollpane block 滚动父级

css - 溢出滚动不适用于绝对定位的元素