JavaScript/wheel:修订间差异
来自康健生活
| (未显示同一用户的4个中间版本) | |||
| 第37行: | 第37行: | ||
==== 放大/缩小 ==== | ==== 放大/缩小 ==== | ||
这里对比一个<code>放大/缩小</code>和<code>向上/向下/向左/向右</code>的动作。 | 这里对比一个<code>放大/缩小</code>和<code>向上/向下/向左/向右</code>的动作。 | ||
{{hcdiff|head= wheel |output=<syntaxhighlight lang="bash" | {{hcdiff|head= wheel |output=<syntaxhighlight lang="bash" highlight="11"> | ||
isTrusted: true | isTrusted: true | ||
altKey: false | altKey: false | ||
| 第86行: | 第86行: | ||
x: 491 | x: 491 | ||
y: 339 | y: 339 | ||
[[Prototype]]: WheelEvent</syntaxhighlight>|output2=<syntaxhighlight lang="bash" | [[Prototype]]: WheelEvent</syntaxhighlight>|output2=<syntaxhighlight lang="bash" highlight="11"> | ||
isTrusted: true | isTrusted: true | ||
altKey: false | altKey: false | ||
| 第137行: | 第137行: | ||
[[Prototype]]: WheelEvent | [[Prototype]]: WheelEvent | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
双指<code>放大/缩小</code>,只有 <code>ctrlKey</code> 值为 <code>true</code>,并且几乎只有 <code>deltaY</code> 发生变化,放大时 <math>deltaY < 0</math>,缩小时 <math>deltaY > 0</math>。 | |||
===== 实现 ===== | |||
=== 监听 wheel 结束 === | |||
== 属性 == | == 属性 == | ||
| 第149行: | 第152行: | ||
* 使用触摸板触发事件,由于系统的平滑处理,会触发多次事件。 | * 使用触摸板触发事件,由于系统的平滑处理,会触发多次事件。 | ||
* IE 下无法使用触摸板触发该事件。{{Qm|有待验证}} | * IE 下无法使用触摸板触发该事件。{{Qm|有待验证}} | ||
== 滚动事件参考 == | |||
<pre> | |||
事件 浏览器 | |||
wheel Chrome(31+), FF(17+), IE(9+) | |||
mousewheel Chrome, IE(6+), Opera, Safari | |||
MozMousePixelScroll FF(3.5 only!) (2010-2013) | |||
DOMMouseScroll FF(0.9.7+) since 2003 | |||
</pre> | |||
== error == | == error == | ||