GlobalEventHandlers

GlobalEventHandlers 描述了一系列web worker的事件接口 HTMLElement, Document, Window, 或 WorkerGlobalScope。这里面的每一个接口都可以添加更多的事件句柄。

Note:GlobalEventHandlers 是一个混入对象(mixin)而不是一个真正的接口,所以无法创建直接基于GlobalEventHandlers 的对象。

属性

除了下面的事件句柄外,此接口不包含任何其他属性。

Event handlers

这些事件定义在 GlobalEventHandlers 中, 并被混入和实现在HTMLElement, Document, Window上,任意html元素、document对象,window对象上均可以使用它提供的属性, 即时是全局的WorkerGlobalScope

GlobalEventHandlers.onabort
这是一个事件句柄 event handler ,当停止abort (en-US) 事件触发时会被调用。
GlobalEventHandlers.onanimationcancel
这是一个事件句柄 event handler ,当 CSS 动画取消animationcancel事件触发时被调用,这表示某个正在执行的CSS动画被取消了。
GlobalEventHandlers.onanimationend
这是一个事件句柄 event handler ,当 CSS 动画播放完成animationend (en-US) 事件触发时被调用,这表示某个CSS动画已经播放完成了。
GlobalEventHandlers.onblur
这是一个事件句柄 event handler ,当失去焦点 blur (en-US) 事件触发时会被调用。
GlobalEventHandlers.onerror
这是一个错误发生时的事件句柄 event handler ,当发生错误error (en-US) 事件时会被调用。
GlobalEventHandlers.onfocus
Is an event handler representing the code to be called when the focus (en-US) event is raised.
GlobalEventHandlers.oncancel
Is an event handler representing the code to be called when the cancel event is raised.
GlobalEventHandlers.oncanplay
Is an event handler representing the code to be called when the canplay (en-US) event is raised.
GlobalEventHandlers.oncanplaythrough
Is an event handler representing the code to be called when the canplaythrough (en-US) event is raised.
GlobalEventHandlers.onchange
Is an event handler representing the code to be called when the change (en-US) event is raised.
GlobalEventHandlers.onclick
Is an event handler representing the code to be called when the click (en-US) event is raised.
GlobalEventHandlers.onclose
Is an event handler representing the code to be called when the close event is raised.
GlobalEventHandlers.oncontextmenu
Is an event handler representing the code to be called when the contextmenu (en-US) event is raised.
GlobalEventHandlers.oncuechange
Is an event handler representing the code to be called when the cuechange (en-US) event is raised.
GlobalEventHandlers.ondblclick
Is an event handler representing the code to be called when the dblclick (en-US) event is raised.
GlobalEventHandlers.ondrag
Is an event handler representing the code to be called when the drag (en-US) event is raised.
GlobalEventHandlers.ondragend (en-US)
Is an event handler representing the code to be called when the dragend (en-US) event is raised.
GlobalEventHandlers.ondragenter (en-US)
Is an event handler representing the code to be called when the dragenter (en-US) event is raised.
GlobalEventHandlers.ondragexit (en-US)
Is an event handler representing the code to be called when the dragexit event is raised.
GlobalEventHandlers.ondragleave
Is an event handler representing the code to be called when the dragleave (en-US) event is raised.
GlobalEventHandlers.ondragover (en-US)
Is an event handler representing the code to be called when the dragover (en-US) event is raised.
GlobalEventHandlers.ondragstart (en-US)
Is an event handler representing the code to be called when the dragstart (en-US) event is raised.
GlobalEventHandlers.ondrop
Is an event handler representing the code to be called when the drop (en-US) event is raised.
GlobalEventHandlers.ondurationchange
Is an event handler representing the code to be called when the durationchange (en-US) event is raised.
GlobalEventHandlers.onemptied (en-US)
Is an event handler representing the code to be called when the emptied (en-US) event is raised.
GlobalEventHandlers.onended
Is an event handler representing the code to be called when the ended (en-US) event is raised.
GlobalEventHandlers.oninput
Is an event handler representing the code to be called when the input (en-US) event is raised.
GlobalEventHandlers.oninvalid
Is an event handler representing the code to be called when the invalid (en-US) event is raised.
GlobalEventHandlers.onkeydown
Is an event handler representing the code to be called when the keydown (en-US) event is raised.
GlobalEventHandlers.onkeypress
Is an event handler representing the code to be called when the keypress (en-US) event is raised.
GlobalEventHandlers.onkeyup
Is an event handler representing the code to be called when the keyup (en-US) event is raised.
GlobalEventHandlers.onload
Is an event handler representing the code to be called when the load (en-US) event is raised.
GlobalEventHandlers.onloadeddata
Is an event handler representing the code to be called when the loadeddata (en-US) event is raised.
GlobalEventHandlers.onloadedmetadata
Is an event handler representing the code to be called when the loadedmetadata (en-US) event is raised.
GlobalEventHandlers.onloadstart
Is an event handler representing the code to be called when the loadstart (en-US) event is raised.
GlobalEventHandlers.onmousedown
Is an event handler representing the code to be called when the mousedown (en-US) event is raised.
GlobalEventHandlers.onmouseenter
Is an event handler representing the code to be called when the mouseenter (en-US) event is raised.
GlobalEventHandlers.onmouseleave
Is an event handler representing the code to be called when the mouseleave (en-US) event is raised.
GlobalEventHandlers.onmousemove
Is an event handler representing the code to be called when the mousemove (en-US) event is raised.
GlobalEventHandlers.onmouseout
Is an event handler representing the code to be called when the mouseout (en-US) event is raised.
GlobalEventHandlers.onmouseover
Is an event handler representing the code to be called when the mouseover (en-US) event is raised.
GlobalEventHandlers.onmouseup
Is an event handler representing the code to be called when the mouseup (en-US) event is raised.
GlobalEventHandlers.onmousewheel (en-US)
Is an event handler representing the code to be called when the mousewheel (en-US) event is raised.
GlobalEventHandler.onmozfullscreenchange
Is an event handler representing the code to be called when the fullscreenchange (en-US) event is raised.
GlobalEventHandler.onmozfullscreenerror
Is an event handler representing the code to be called when the fullscreenerror (en-US) event is raised.
GlobalEventHandlers.onpause
Is an event handler representing the code to be called when the pause (en-US) event is raised.
GlobalEventHandlers.onplay
Is an event handler representing the code to be called when the play (en-US) event is raised.
GlobalEventHandlers.onplaying
Is an event handler representing the code to be called when the playing (en-US) event is raised.
GlobalEventHandlers.onpointerdown
Is an event handler representing the code to be called when the pointerdown event is raised.
GlobalEventHandlers.onpointermove
Is an event handler representing the code to be called when the pointermove event is raised.
GlobalEventHandlers.onpointerup
Is an event handler representing the code to be called when the pointerup event is raised.
GlobalEventHandlers.onpointercancel
Is an event handler representing the code to be called when the pointercancel event is raised.
GlobalEventHandlers.onpointerover
Is an event handler representing the code to be called when the pointerover event is raised.
GlobalEventHandlers.onpointerout
Is an event handler representing the code to be called when the pointerout event is raised.
GlobalEventHandlers.onpointerenter
Is an event handler representing the code to be called when the pointerevent event is raised.
GlobalEventHandlers.onpointerleave
Is an event handler representing the code to be called when the pointerleave event is raised.
GlobalEventHandlers.onpointerlockchange
Is an event handler representing the code to be called when the pointerlockchange (en-US) event is raised.
GlobalEventHandlers.onpointerlockerror
Is an event handler representing the code to be called when the pointerlockerror (en-US) event is raised.
GlobalEventHandlers.onprogress
Is an event handler representing the code to be called when the progress (en-US) event is raised.
GlobalEventHandlers.onratechange
Is an event handler representing the code to be called when the ratechange (en-US) event is raised.
GlobalEventHandlers.onreset
Is an event handler representing the code to be called when the reset (en-US) event is raised.
GlobalEventHandlers.onscroll
Is an event handler representing the code to be called when the scroll (en-US) event is raised.
GlobalEventHandlers.onseeked
Is an event handler representing the code to be called when the seeked (en-US) event is raised.
GlobalEventHandlers.onseeking
Is an event handler representing the code to be called when the seeking (en-US) event is raised.
GlobalEventHandlers.onselect
Is an event handler representing the code to be called when the select (en-US) event is raised.
GlobalEventHandlers.onshow
Is an event handler representing the code to be called when the show (en-US) event is raised.
GlobalEventHandlers.onsort
Is an event handler representing the code to be called when the sort event is raised.
GlobalEventHandlers.onstalled
Is an event handler representing the code to be called when the stalled (en-US) event is raised.
GlobalEventHandlers.onsubmit
Is an event handler representing the code to be called when the submit (en-US) event is raised.
GlobalEventHandlers.onsuspend
Is an event handler representing the code to be called when the suspend (en-US) event is raised.
GlobalEventHandlers.ontimeupdate
Is an event handler representing the code to be called when the timeupdate (en-US) event is raised.
GlobalEventHandlers.onvolumechange
Is an event handler representing the code to be called when the volumechange (en-US) event is raised.
GlobalEventHandlers.onwaiting
Is an event handler representing the code to be called when the waiting (en-US) event is raised.

Methods

This interface defines no method.

Specifications

Specification Status Comment
Pointer Lock
Extension of Document
Candidate Recommendation Adds onpointerlockchange and onpointerlockerror on Document. It is experimentally implemented on GlobalEventHandlers.
HTML Living Standard
GlobalEventHandlers
Living Standard No change since the latest snapshot, HTML 5.1.
HTML 5.1
GlobalEventHandlers
Recommendation Snapshot of HTML Living Standard. Added onsort since the Unknown snapshot.
HTML5
GlobalEventHandlers
Recommendation Snapshot of HTML Living Standard. Creation of GlobalEventHandlers (properties where on the target before it).

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help! (en-US)

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support (Yes) (Yes) ? ? ?
oncanplay, oncanplaythrough, ondurationchange, onemptied, onended, onloadeddata, onloadedmetadata, onloadstart, onpause, onplay, onplaying, onprogress, onratechange, onseeked, onseeking, onstalled, ontimeupdate, onvolumechange, onwaiting 3.5 (1.9.1) ? ? ? ?
onsuspend 3.6 (1.9.2) ? ? ? ?
ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop 3.5 (1.9.1) ? ? ? ?
onmouseenter, onmouseleave 10 (10) 30.0 5.5 17 ?
ondragexit 未实现 ? ? ? ?
oncancel 未实现 ? ? ? ?
onclose 未实现 ? ? ? ?
oncuechange 未实现 ? ? ? ?
ondragexit 未实现 ? ? ? ?
onmousewheel 未实现 ? ? ? ?
onsort 未实现 ? ? ? ?
onmozfullscreenchange, onmozfullscreenerror (Yes) 未实现 未实现 未实现 未实现
onpointerlockchange, onpointerlockerror 10 (10) as onmozpointerlockchange, onmozpointerlockerror (Yes) as onwebkitpointerlockchange, onwebkitpointerlockerror ? ? ?
onpointercancel, onpointerdown, onpointerup, onpointermove, onpointerout, onpointerover, onpointerenter, onpointerleave, ongotpointercapture, onlostpointercapture (Yes) behind the dom.w3c_pointer_events.enabled pref (disabled by default) 未实现 (Yes) ? ?
Feature Firefox Mobile (Gecko) Android IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) ? ? ? ?
ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop 1.0 (1.9.1) ? ? ? ?
oncanplay, oncanplaythrough, ondurationchange, onemptied, onended, onloadeddata, onloadedmetadata, onloadstart, onpause, onplay, onplaying, onprogress, onratechange, onseeked, onseeking, onstalled, ontimeupdate, onvolumechange, onwaiting 1.0 (1.9.1) ? ? ? ?
onmouseenter, onmouseleave 10.0 (10) ? ? ? ?
onsuspend 1.0 (1.9.2) ? ? ? ?
ondragexit {CompatNo}} ? ? ? ?
oncancel 未实现 ? ? ? ?
onclose 未实现 ? ? ? ?
oncuechange 未实现 ? ? ? ?
ondragexit 未实现 ? ? ? ?
onmousewheel 未实现 ? ? ? ?
onsort 未实现 ? ? ? ?
onmozfullscreenchange, onmozfullscreenerror (Yes) 未实现 未实现 未实现 未实现
onpointerlockchange, onpointerlockerror 10.0 (10) as onmozpointerlockchange, onmozpointerlockerror ? ? ? ?
onpointercancel, onpointerdown, onpointerup, onpointermove, onpointerout, onpointerover, onpointerenter, onpointerleave, ongotpointercapture, onlostpointercapture (Yes) behind the dom.w3c_pointer_events.enabled pref (disabled by default) 未实现 ? 未实现 未实现

See also