We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cbf1878 commit 17be6bbCopy full SHA for 17be6bb
1 file changed
docs/events/event.md
@@ -190,6 +190,20 @@ evt.isTrusted // false
190
191
上面代码中,`evt`对象是脚本产生的,所以`isTrusted`属性返回`false`。
192
193
+### Event.detail
194
+
195
+`Event.detail`属性只有浏览器的 UI (用户界面)事件才具有。该属性返回一个数值,表示事件的某种信息。具体含义与事件类型相关。比如,对于`click`和`dbclick`事件,`Event.detail`是鼠标按下的次数(`1`表示单击,`2`表示双击,`3`表示三击);对于鼠标滚轮事件,`Event.detail`是滚轮正向滚动的距离,负值就是负向滚动的距离,返回值总是3的倍数。
196
197
+```javascript
198
+// HTML 代码如下
199
+// <p>Hello</p>
200
+function giveDetails(e) {
201
+ console.log(e.detail);
202
+}
203
204
+document.selectQuery('p') = giveDetails;
205
+```
206
207
## 实例方法
208
209
### Event.preventDefault()
0 commit comments