UIEvent()

翻译不完整。 请帮助我们翻译这篇文章!

UIEvent() 作为构造函数,可用于构造一个新的 UIEvent 对象.

语法

event = new UIEvent(typeArg [, UIEventInit])

Values

typeArg
传递的是一个 DOMString类型的字符串,用来命名且重新发布的事件。
UIEventInit 可选
是 UIEventInit 集合, 它拥有以下属性:
  • detail: 可选,默认为long类型的0数值, 用来标记事件的关联值. UIEvent.detail 列出了标准事件的语义.
  • view: 可选,默认为null,类型为 WindowProxy, 用来关联Window 与event本身.
  • sourceCapabilities: 一个 InputDeviceCapabilities 类型的接口实例(对象),用来提供物理设备的触摸信息。

UIEventInit 合集依然接受从EventInit 定义来的合集.

Specifications

Specification Status Comment
InputDeviceCapabilities Draft Added sourceCapabilities property.
Document Object Model (DOM) Level 3 Events Specification
UIEvent()
Obsolete Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
UIEvent() constructorChrome Full support YesEdge Full support ≤18Firefox Full support 11IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 14Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

  • UIEvent, the interface of the objects it constructs.