我可以使用css或jQuery更改滚动速度吗?

问题描述:

在本 jsFiddle示例中,我想减小div的内容的滚动速度,特别是在使用鼠标滚轮时

In this jsFiddle example, I would like to reduce the scroll speed of the div's content, especially when using the mouse wheel, as one one wheel scrolls approxilately the div's height.

是否可以使用CSS控制,如果没有,可以使用javascript(也许使用jQuery)?

Is it possible to control that with CSS, and if not, javascript (perhaps using jQuery) ?

注意:我意识到,滚动速度可能会因操作系统/浏览器和浏览器设置而有所不同。但我认为在大多数情况下,滚动速度(当使用鼠标滚轮)太快,所以我想减慢速度。

Note: I realize that the scroll speed might differ between os/browers and browser settings. But I think that in the majority of the cases, the scroll speed (when using the mouse wheel) is too fast, so I would like to slow it down.

否。滚动速度由浏览器确定(通常直接由计算机/设备上的设置确定)。 CSS和Javascript不会(或不应该)有任何方式影响系统设置。

No. Scroll speed is determined by the browser (and usually directly by the settings on the computer/device). CSS and Javascript don't (or shouldn't) have any way to affect system settings.

话虽如此,可能有很多方法可以尝试通过以防止滚动的方式移动您自己的内容,以不同的滚动速度 。但是,我认为这样做在可用性,可访问性和对用户的尊重方面是一种 HORRIBLE 的创意,但我会首先找到目标浏览器触发的事件表示滚动。

That being said, there are likely a number of ways you could try to fake a different scroll speed by moving your own content around in such a way as to counteract scrolling. However, I think doing so is a HORRIBLE idea in terms of usability, accessibility, and respect for your users, but I would start by finding events that your target browsers fire that indicate scrolling.

一旦你可以捕获滚动事件(假设你可以),你将能够动态调整你的内容,使你想要的部分是可见的。

Once you can capture the scroll event (assuming you can), then you would be able to adjust your content dynamically so that the portion you want is visible.

另一种方法是在Flash中处理这个问题, 给你至少一些级别的滚动事件。

Another approach would be to deal with this in Flash, which does give you at least some level of control over scrolling events.