触摸
Event()
构造函数创建新
TouchEvent
.
event = new TouchEvent(typeArg, touchEventInit);
DOMString
表示事件的名称。
EventInit
字典,拥有以下字段:
"touches"
, optional and defaulting to
[]
, of type
Touch[]
, that is a list of objects for every point of contact currently touching the surface.
"targetTouches"
, optional and defaulting to
[],
类型
Touch[]
, that is a list of objects for every point of contact that is touching the surface
and
started on the element that is the target of the current event.
"changedTouches"
, optional and defaulting to
[]
, of type
Touch[]
, that is a list of objects for every point of contact which contributed to the event.
"ctrlKey"
, optional and defaulting to
false
, of type
布尔
, that indicates if the
ctrl
key was simultaneously pressed.
"shiftKey"
, optional and defaulting to
false
, of type
布尔
, that indicates if the
shift
key was simultaneously pressed.
"altKey"
, optional and defaulting to
false
, of type
布尔
, that indicates if the
alt
key was simultaneously pressed.
"metaKey"
, optional and defaulting to
false
, of type
布尔
, that indicates if the
meta
key was simultaneously pressed.
The Touch
EventInit
字典还接受字段来自
UIEventInit
和来自
EventInit
字典。
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
TouchEvent()
构造函数
|
Chrome
48
|
Edge
≤79
|
Firefox ? | IE No | Opera Yes | Safari No |
WebView Android
48
|
Chrome Android
48
|
Firefox Android Yes | Opera Android Yes | Safari iOS 3.2 |
Samsung Internet Android
5.0
|
完整支持
不支持
兼容性未知
见实现注意事项。
TouchEvent
,构造对象的接口。
TouchEvent
TouchEvent()