【发布时间】:2014-04-17 07:57:26
【问题描述】:
如何在 Dart 中标准化跨浏览器的鼠标滚轮速度?
对于 Javascript 也有类似的讨论:Normalizing mousewheel speed across browsers
假设 Dart 应该自动提供统一的车轮读数,我填写了这张票:
https://code.google.com/p/dart/issues/detail?id=18256
同时我正在使用这个解决方法:
int normalizeWheel(int dy) {
if (dy.abs() < 100) {
// Firefox: Nx3
return dy * 100 ~/ 3;
}
if (dy % 120 == 0) {
// IE: Nx120
return dy * 100 ~/ 120;
}
if (dy % 100 == 0) {
// Chrome, Opera: Nx100
return dy;
}
return dy; // unknown browser
}
请指出 Dart 处理浏览器之间鼠标滚轮速度差异的方法。
【问题讨论】:
标签: html cross-browser dart mouse mousewheel