使用鼠标滚轮事件在网站上滚动了多少像素? [英] How many pixels are scrolled on a website with a mouse wheel down event?

查看:602
本文介绍了使用鼠标滚轮事件在网站上滚动了多少像素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写自定义滚动条并正在捕捉鼠标滚轮事件。我正在使用它然后调整我要滚动的元素的scrollTop。

I'm working on writing a custom scrollbar and am catching the mousewheel event. I'm using this to then adjust the scrollTop of the element I want to scroll on.

是否有向下滚动的标准像素数,或者它是否有所不同从系统到系统?

Is there a standard number of pixels that are scrolled down, or does it vary from system to system?

我在最新版本的Firefox中显示114px:

I'm showing 114px in the latest build of Firefox:

推荐答案

许多鼠标驱动程序允许您设置鼠标滚轮滚动的距离,因此没有标准距离。我会尝试你的代码一段时间,并选择一个距离,让你不要滚动整天,但不会在每个卷轴跳跃一英里。你需要感觉出来。让朋友们给予反馈,这有助于让几只手触摸这种东西。

Many mouse drivers let you set the distance scrolled by the mouse wheel, so there is not a standard distance. I'd try your code out for a while and pick a distance that keeps you from scrolling all day but doesn't jump a mile at each scroll. You'll kind of need to "feel" it out. Get friends to give feedback, it helps to let a few hands touch this kind of thing.

这篇关于使用鼠标滚轮事件在网站上滚动了多少像素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆