UIEvent

翻譯不完整。請協助 翻譯此英文文件

UIEvent interface 是使用者介面的事件的基本型態。

UIEvent 是從 Event衍伸過來。 雖然為了兼容性,仍留著 UIEvent.initUIEvent() method,建立 UIEvent object 最好是選擇以 UIEvent() constructor 建立。

許多 interfaces 直接或間接繼承此 interface ,例如:MouseEvent 、 TouchEvent 、 FocusEventKeyboardEvent 、 WheelEvent 、 InputEvent 和 CompositionEvent

Constructors

UIEvent()
建立一個 UIEvent object 。

Properties

這個 interface 亦繼承其父-- Event 的 properties:

UIEvent.cancelBubble
Is a Boolean indicating whether the bubbling of the event has been canceled or not.
UIEvent.detailRead only
Returns a long with details about the event, depending on the event type.
UIEvent.isChar Read only
Returns a Boolean indicating whether the event produced a key character or not.
UIEvent.layerX Read only
Returns the horizontal coordinate of the event relative to the current layer.
UIEvent.layerY Read only
Returns the vertical coordinate of the event relative to the current layer.
UIEvent.pageX Read only
Returns the horizontal coordinate of the event relative to the whole document.
UIEvent.pageY Read only
Returns the vertical coordinate of the event relative to the whole document.
UIEvent.viewRead only
Returns a WindowProxy that contains the view that generated the event.
UIEvent.which Read only
Returns the numeric keyCode of the key pressed, or the character code (charCode) for an alphanumeric key pressed.

Methods

這個 interface 亦繼承其父-- Event 的 methods :

UIEvent.initUIEvent()
初始化 UIEvent object。若該事件已經觸發的話,此 method 就不會執行任何東西。

規格

Specification Status Comment
Document Object Model (DOM) Level 3 Events Specification
The definition of 'UIEvent' in that specification.
Working Draft 來自 Document Object Model (DOM) Level 2 Events Specification
  • 追加 UIEvent() constructor,
  • 淘汰 initUIEvent() method
  • 變更 view 的類型,從原本的 AbstractView 變為 WindowProxy
Document Object Model (DOM) Level 2 Events Specification
The definition of 'UIEvent' in that specification.
Recommendation 最初的定義。

瀏覽器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) ? (Yes) ?
UIEvent() (Yes) 11 (11) ? (Yes) ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) ? (Yes) ?
UIEvent() (Yes) 11.0 (11) ? (Yes) ?

延伸閱讀

文件標籤與貢獻者

標籤: 
 此頁面的貢獻者: Shiyou
 最近更新: Shiyou,