浏览器事件总结

2 篇文章 0 订阅

原文来源于MDN,有时候MDN无法访问,可以自己参考下面的说明。

DOM 事件被发送用于通知代码相关的事情已经发生了。每个事件都是继承自Event 类的对象,可以包括自定义的成员属性及函数用于获取事件发生时相关的更多信息。事件可以表示从基本用户交互到渲染模型中发生的事件的自动通知的所有内容。

本文提供了一个可以发送的事件的列表;一些是官方标准中的标准事件,另一些则是在特定浏览器内部使用的事件;例如,Mozilla 列出的特定事件使 拓展 可以用它们与浏览器交互。

最常见的类别

事件名称何时触发
cachedmanifest中列出的资源已经下载,应用程序现在已缓存。
error资源加载失败时
abort正在加载资源已经被中止时
load资源及其相关资源已完成加载。
beforeunloadwindow,document 及其资源即将被卸载。
unload文档或一个依赖资源正在被卸载。

网络事件

事件名称何时触发
online浏览器已获得网络访问。
offline浏览器已失去网络访问。
事件名称何时触发
focus元素获得焦点(不会冒泡)
blur元素失去焦点(不会冒泡)

Websocket事件

事件名称何时触发
openWebSocket连接已建立
message通过WebSocket接收到一条消息
errorWebSocket连接异常被关闭(比如有些数据无法发送)。
closeWebSocket连接已关闭
事件名称何时触发
pagehideA session history entry is being traversed from.
pageshowA session history entry is being traversed to.
popstateA session history entry is being navigated to (in certain cases).
事件触发何时触发
animationstart某个CSS动画开始时触发
animationend某个CSS动画完成时触发
animationiteration某个CSS动画完成后重新开始时触发
事件名称何时触发
reset点击重置按钮时
submit点击提交按钮
时间名称何时触发
beforeprint打印机已经就绪时触发
afterprint打印机关闭时触发
Event NameFired When
compositionstartThe composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
compositionupdateA character is added to a passage of text being composed.
compositionendThe composition of a passage of text has been completed or canceled.
Event NameFired When
fullscreenchangeAn element was turned to fullscreen mode or back to normal mode.
fullscreenerrorIt was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.
resizeThe document view has been resized.
scrollThe document view or an element has been scrolled.
Event NameFired When
cut已经剪贴选中的文本内容并且复制到了剪贴板
copy已经把选中的文本内容复制到了剪贴板
paste从剪贴板复制的文本内容被粘贴
Event NameFired When
keydown按下任意按键
keypress除 Shift, Fn, CapsLock 外任意键被按住. (连续触发)
keyup释放任意按键
Event NameFired When
mouseenter指针移到有事件监听的元素内
mouseover指针移到有事件监听的元素或者它的子元素内
mousemove指针在元素内移动时持续触发
mousedown在元素上按下任意鼠标按钮
mouseup在元素上释放任意鼠标按键
click在元素上按下并释放任意鼠标按键
dblclick在元素上双击鼠标按钮
contextmenu右键点击 (右键菜单显示前).
wheel滚轮向任意方向滚动
mouseleave指针移出元素范围外(不冒泡)
mouseout指针移出元素,或者移到它的子元素上
select文本被选中被选中
pointerlockchange鼠标被锁定或者解除锁定发生时
pointerlockerror可能因为一些技术的原因鼠标锁定被禁止时。
Event NameFired When
dragstart用户开始拖动HTML元素或选中的文本
drag正在拖动元素或文本选区(在此过程中持续触发,每350ms触发一次)
dragend拖放操作结束 (松开鼠标按钮或按下Esc键)
dragenter被拖动的元素或文本选区移入有效释放目标区
dragover被拖动的元素或文本选区正在有效释放目标上被拖动 (在此过程中持续触发,每350ms触发一次)
dragleave被拖动的元素或文本选区移出有效释放目标区
drop元素在有效释放目标区上释放
Event NameFired When
durationchangeThe duration attribute has been updated.
loadedmetadataThe metadata has been loaded.
loadeddataThe first frame of the media has finished loading.
canplayThe browser can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
canplaythroughThe browser estimates it can play the media up to its end without stopping for content buffering.
endedPlayback has stopped because the end of the media was reached.
emptiedThe media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load()method is called to reload it.
stalledThe user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
suspendMedia data loading has been suspended.
playPlayback has begun.
playingPlayback is ready to start after having been paused or delayed due to lack of data.
pausePlayback has been paused.
waitingPlayback has stopped because of a temporary lack of data.
seekingA seek operation began.
seekedA seek operation completed.
ratechangeThe playback rate has changed.
timeupdateThe time indicated by the currentTime attribute has been updated.
volumechangeThe volume has changed.
completeThe rendering of an OfflineAudioContext is terminated.
endedPlayback has stopped because the end of the media was reached.
audioprocessThe input buffer of a ScriptProcessorNode is ready to be processed.
Event NameFired When
loadstartProgress has begun.
progressIn progress.
errorProgression has failed.
timeoutProgression is terminated due to preset time expiring.
abortProgression has been terminated (not due to an error).
loadProgression has been successful.
loadendProgress has stopped (after "error", "abort" or "load" have been dispatched).

存储事件

change (see Non-standard events)storage

更新事件

checkingdownloadingerrornoupdateobsoleteupdateready

值变化事件

broadcastCheckboxStateChangehashchangeinputRadioStateChangereadystatechangeValueChange

未分类的事件

invalidlocalizedmessagemessagemessageopenshow

不常见 和 非标准分类

SVG事件

SVGAbortSVGErrorSVGLoadSVGResizeSVGScrollSVGUnloadSVGZoom

数据库事件

abortblockedcompleteerror(link)successupgradeneededversionchange

通知事件

AlertActiveAlertClose

CSS事件

CssRuleViewRefreshedCssRuleViewChangedCssRuleViewCSSLinkClickedtransitionend

脚本事件

afterscriptexecutebeforescriptexecute

菜单事件

DOMMenuItemActiveDOMMenuItemInactive

窗口事件

DOMWindowCreatedDOMTitleChangedDOMWindowCloseSSWindowClosingSSWindowStateReadySSWindowStateBusyclose

文档事件

DOMLinkAddedDOMLinkRemovedDOMMetaAddedDOMMetaRemovedDOMWillOpenModalDialogDOMModalDialogClosed

弹出事件

popuphiddenpopuphidingpopupshowingpopupshownDOMPopupBlocked

Tab事件

TabOpenTabCloseTabSelectTabShowTabHideTabPinnedTabUnpinnedSSTabClosingSSTabRestoringSSTabRestoredvisibilitychange

电池事件

chargingchangechargingtimechangedischargingtimechangelevelchange

呼叫事件

alertingbusycallschangedcfstatechangeconnectedconnectingdialingdisconnecteddisconnectingerrorheld, holdingincomingresumingstatechangevoicechange

传感器事件

compassneedscalibrationdevicelightdevicemotiondeviceorientationdeviceproximityMozOrientationorientationchangeuserproximity

智能卡事件

icccardlockerroriccinfochangesmartcard-insertsmartcard-removestkcommandstksessionendcardstatechange

短信和USSD事件

deliveredreceivedsentussdreceived

帧事件

mozbrowserclosemozbrowsercontextmenumozbrowsererrormozbrowsericonchangemozbrowserlocationchangemozbrowserloadendmozbrowserloadstartmozbrowseropenwindowmozbrowsersecuritychangemozbrowsershowmodalprompt(link)mozbrowsertitlechangeDOMFrameContentLoaded

DOM变异事件

DOMAttributeNameChangedDOMAttrModifiedDOMCharacterDataModifiedDOMContentLoadedDOMElementNameChangedDOMNodeInsertedDOMNodeInsertedIntoDocumentDOMNodeRemovedDOMNodeRemovedFromDocumentDOMSubtreeModified

触摸事件

MozEdgeUIGestureMozMagnifyGestureMozMagnifyGestureStartMozMagnifyGestureUpdateMozPressTapGestureMozRotateGestureMozRotateGestureStartMozRotateGestureUpdateMozSwipeGestureMozTapGestureMozTouchDownMozTouchMoveMozTouchUptouchcanceltouchendtouchentertouchleavetouchmovetouchstart

指针事件

pointeroverpointerenterpointerdownpointermovepointeruppointercancelpointeroutpointerleavegotpointercapturelostpointercapture

标准事件

这些事件在官方Web规范中定义,并且应在各个浏览器中通用。 每个事件都和代表事件接收方的对象(由此您可以查到每个事件提供的数据),定义这个事件的标准或标准链接会一起列出。

事件名称事件类型规范触发时机...
abortUIEventDOM L3资源载入已被中止
abortProgressEventProgressandXMLHttpRequestProgress被终止(不是error造成的)
abortEventIndexedDB事务已被中止
afterprintEventHTML5相关文档已开始打印或打印预览已被关闭
animationendAnimationEventCSS Animations完成一个CSS 动画
animationiterationAnimationEventCSS Animations重复播放一个CSS 动画
animationstartAnimationEventCSS Animations一个CSS 动画已开始
audioprocessAudioProcessingEventWeb Audio API audioprocess一个ScriptProcessorNode的输入缓冲区可处理
audioendEventWeb Speech API用户代理捕捉到用以语音识别的音频
audiostartEventWeb Speech API用户代理开始捕捉用以语音识别的音频
beforeprintEventHTML5相关文档将要开始打印或准备打印预览
beforeunloadBeforeUnloadEventHTML5即将卸载 window,document 及其资源
beginEventTimeEventSVGASMILanimation element begins.
blocked_indexedDBIDBVersionChangeEventIndexedDBAn open connection to a database is blocking aversionchangetransaction on the same database.
blurFocusEventDOM L3元素失去焦点 (不会冒泡).
boundarySpeechSynthesisEventSpeechSynthesisEvent 
cachedEventOfflineThe resources listed in the manifest have been downloaded, and the application is now cached.
canplayEventHTML5 mediaThe user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
canplaythroughEventHTML5 mediaThe user agent can play the media, and estimates that enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
changeEventDOM L2,HTML5An element loses focus and its value changed since gaining focus.
chargingchangeEventBattery statusThe battery begins or stops charging.
chargingtimechangeEventBattery statusThechargingTimeattribute has been updated.
checkingEventOfflineThe user agent is checking for an update, or attempting to download the cache manifest for the first time.
clickMouseEventDOM L3A pointing device button has been pressed and released on an element.
closeEventWebSocketA WebSocket connection has been closed.
complete IndexedDB 
completeOfflineAudioCompletionEventWeb Audio API OfflineAudioCompletionEventThe rendering of an OfflineAudioContext is terminated.
compositionendCompositionEventDOM L3The composition of a passage of text has been completed or canceled.
compositionstartCompositionEventDOM L3The composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
compositionupdateCompositionEventDOM L3A character is added to a passage of text being composed.
contextmenuMouseEventHTML5The right button of the mouse is clicked (before the context menu is displayed).
copyClipboardEventClipboardThe text selection has been added to the clipboard.
cutClipboardEventClipboardThe text selection has been removed from the document and added to the clipboard.
dblclickMouseEventDOM L3A pointing device button is clicked twice on an element.
devicelightDeviceLightEventAmbient Light EventsFresh data is available from a light sensor.
devicemotionDeviceMotionEventDevice Orientation EventsFresh data is available from a motion sensor.
deviceorientationDeviceOrientationEventDevice Orientation EventsFresh data is available from an orientation sensor.
deviceproximityDeviceProximityEventProximity EventsFresh data is available from a proximity sensor (indicates an approximated distance between the device and a nearby object).
dischargingtimechangeEventBattery statusThedischargingTimeattribute has been updated.
DOMActivateUIEventDOM L3A button, link or state changing element is activated (use clickinstead).
DOMAttributeNameChangedMutationNameEventDOM L3RemovedThe name of an attribute changed (usemutation observersinstead).
DOMAttrModifiedMutationEventDOM L3The value of an attribute has been modified (usemutation observersinstead).
DOMCharacterDataModifiedMutationEventDOM L3A text or anotherCharacterDatahas changed (usemutation observersinstead).
DOMContentLoadedEventHTML5The document has finished loading (but not its dependent resources).
DOMElementNameChangedMutationNameEventDOM L3RemovedThe name of an element changed (usemutation observersinstead).
DOMFocusInFocusEventDOM L3An element has received focus (use focus or focusininstead).
DOMFocusOutFocusEventDOM L3An element has lost focus (use blur or focusout instead).
DOMNodeInsertedMutationEventDOM L3A node has been added as a child of another node (usemutation observersinstead).
DOMNodeInsertedIntoDocumentMutationEventDOM L3A node has been inserted into the document (usemutation observersinstead).
DOMNodeRemovedMutationEventDOM L3A node has been removed from its parent node (usemutation observersinstead).
DOMNodeRemovedFromDocumentMutationEventDOM L3A node has been removed from the document (usemutation observersinstead).
DOMSubtreeModifiedMutationEventDOM L3A change happened in the document (usemutation observersinstead).
downloadingEventOfflineThe user agent has found an update and is fetching it, or is downloading the resources listed by the cache manifest for the first time.
dragDragEventHTML5An element or text selection is being dragged (every 350ms).
dragendDragEventHTML5A drag operation is being ended (by releasing a mouse button or hitting the escape key).
dragenterDragEventHTML5A dragged element or text selection enters a valid drop target.
dragleaveDragEventHTML5A dragged element or text selection leaves a valid drop target.
dragoverDragEventHTML5An element or text selection is being dragged over a valid drop target (every 350ms).
dragstartDragEventHTML5The user starts dragging an element or text selection.
dropDragEventHTML5An element is dropped on a valid drop target.
durationchangeEventHTML5 mediaThedurationattribute has been updated.
emptiedEventHTML5 mediaThe media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and theload()method is called to reload it.
endedEventHTML5 mediaPlayback has stopped because the end of the media was reached.
endedEventWeb Audio API 
endEventTimeEventSVGASMILanimation element ends.
errorUIEventDOM L3A resource failed to load.
errorProgressEventProgressandXMLHttpRequestProgression has failed.
errorEventOfflineAn error occurred while downloading the cache manifest or updating the content of the application.
errorEventWebSocketA WebSocket connection has been closed with prejudice (some data couldn't be sent for example).
errorEventServer Sent EventsAn event source connection has been failed.
errorEventIndexedDBA request caused an error and failed.
focusFocusEventDOM L3An element has received focus (does not bubble).
focusinFocusEventDOM L3An element is about to receive focus (bubbles).
focusoutFocusEventDOM L3An element is about to lose focus (bubbles).
fullscreenchangeEventFull ScreenAn element was turned to fullscreen mode or back to normal mode.
fullscreenerrorEventFull ScreenIt was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.
gamepadconnectedGamepadEventGamepadA gamepad has been connected.
gamepaddisconnectedGamepadEventGamepadA gamepad has been disconnected.
hashchangeHashChangeEventHTML5The fragment identifier of the URL has changed (the part of the URL after the #).
lostpointercapturePointerEventPointer Events 
inputEventHTML5The value of an element changes or the content of an element with the attributecontenteditableis modified.
invalidEventHTML5A submittable element has been checked and doesn't satisfy its constraints.
keydownKeyboardEventDOM L3A key is pressed down.
keypressKeyboardEventDOM L3A key is pressed down and that key normally produces a character value (use input instead).
keyupKeyboardEventDOM L3A key is released.
languagechangeEvent  
levelchangeEventBattery statusThelevelattribute has been updated.
loadUIEventDOM L3A resource and its dependent resources have finished loading.
loadProgressEventProgressandXMLHttpRequestProgression has been successful.
loadeddataEventHTML5 mediaThe first frame of the media has finished loading.
loadedmetadataEventHTML5 mediaThe metadata has been loaded.
loadendProgressEventProgressandXMLHttpRequestProgress has stopped (after "error", "abort" or "load" have been dispatched).
loadstartProgressEventProgressandXMLHttpRequestProgress has begun.
markSpeechSynthesisEventWeb Speech API 
messageMessageEventWebSocketA message is received through a WebSocket.
messageMessageEventWeb WorkersA message is received from a Web Worker.
messageMessageEventWeb MessagingA message is received from a child (i)frame or a parent window.
messageMessageEventServer Sent EventsA message is received through an event source.
mousedownMouseEventDOM L3A pointing device button (usually a mouse) is pressed on an element.
mouseenterMouseEventDOM L3A pointing device is moved onto the element that has the listener attached.
mouseleaveMouseEventDOM L3A pointing device is moved off the element that has the listener attached.
mousemoveMouseEventDOM L3A pointing device is moved over an element.
mouseoutMouseEventDOM L3A pointing device is moved off the element that has the listener attached or off one of its children.
mouseoverMouseEventDOM L3A pointing device is moved onto the element that has the listener attached or onto one of its children.
mouseupMouseEventDOM L3A pointing device button is released over an element.
noupdateEventOfflineThe manifest hadn't changed.
obsoleteEventOfflineThe manifest was found to have become a 404 or 410 page, so the application cache is being deleted.
offlineEventHTML5 offlineThe browser has lost access to the network.
onlineEventHTML5 offlineThe browser has gained access to the network (but particular websites might be unreachable).
openEventWebSocketA WebSocket connection has been established.
openEventServer Sent EventsAn event source connection has been established.
orientationchangeEventScreen OrientationThe orientation of the device (portrait/landscape) has changed
pagehidePageTransitionEventHTML5A session history entry is being traversed from.
pageshowPageTransitionEventHTML5A session history entry is being traversed to.
pasteClipboardEventClipboardData has been transfered from the system clipboard to the document.
pauseEventHTML5 mediaPlayback has been paused.
pointerlockchangeEventPointer LockThe pointer was locked or released.
pointerlockerrorEventPointer LockIt was impossible to lock the pointer for technical reasons or because the permission was denied.
playEventHTML5 mediaPlayback has begun.
playingEventHTML5 mediaPlayback is ready to start after having been paused or delayed due to lack of data.
popstatePopStateEventHTML5A session history entry is being navigated to (in certain cases).
progressProgressEventProgressandXMLHttpRequestIn progress.
progressProgressEventOfflineThe user agent is downloading resources listed by the manifest.
ratechangeEventHTML5 mediaThe playback rate has changed.
readystatechangeEventHTML5andXMLHttpRequestThe readyState attribute of a document has changed.
repeatEventTimeEventSVGASMILanimation element is repeated.
resetEventDOM L2,HTML5A form is reset.
resizeUIEventDOM L3The document view has been resized.
scrollUIEventDOM L3The document view or an element has been scrolled.
seekedEventHTML5 mediaAseekoperation completed.
seekingEventHTML5 mediaAseekoperation began.
selectUIEventDOM L3Some text is being selected.
showMouseEventHTML5A contextmenu event was fired on/bubbled to an element that has acontextmenuattribute
stalledEventHTML5 mediaThe user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
storageStorageEventWeb StorageA storage area (localStorageorsessionStorage) has changed.
submitEventDOM L2,HTML5A form is submitted.
successEventIndexedDBA request successfully completed.
suspendEventHTML5 mediaMedia data loading has been suspended.
SVGAbortSVGEventSVGPage loading has been stopped before theSVGwas loaded.
SVGErrorSVGEventSVGAn error has occurred before theSVGwas loaded.
SVGLoadSVGEventSVGAnSVGdocument has been loaded and parsed.
SVGResizeSVGEventSVGAnSVGdocument is being resized.
SVGScrollSVGEventSVGAnSVGdocument is being scrolled.
SVGUnloadSVGEventSVGAnSVGdocument has been removed from a window or frame.
SVGZoomSVGZoomEventSVGAnSVGdocument is being zoomed.
timeoutProgressEventXMLHttpRequest 
timeupdateEventHTML5 mediaThe time indicated by thecurrentTimeattribute has been updated.
touchcancelTouchEventTouch EventsA touch point has been disrupted in an implementation-specific manners (too many touch points for example).
touchendTouchEventTouch EventsA touch point is removed from the touch surface.
touchenterTouchEventTouch EventsRemovedA touch point is moved onto the interactive area of an element.
touchleaveTouchEventTouch EventsRemovedA touch point is moved off the interactive area of an element.
touchmoveTouchEventTouch EventsA touch point is moved along the touch surface.
touchstartTouchEventTouch EventsA touch point is placed on the touch surface.
transitionendTransitionEventCSS TransitionsACSS transitionhas completed.
unloadUIEventDOM L3The document or a dependent resource is being unloaded.
updatereadyEventOfflineThe resources listed in the manifest have been newly redownloaded, and the script can useswapCache()to switch to the new cache.
upgradeneeded IndexedDBAn attempt was made to open a database with a version number higher than its current version. Aversionchangetransaction has been created.
userproximitySensorEventSensorFresh data is available from a proximity sensor (indicates whether the nearby object isnearthe device or not).
versionchange IndexedDBAversionchangetransaction completed.
visibilitychangeEventPage visibilityThe content of a tab has become visible or has been hidden.
volumechangeEventHTML5 mediaThe volume has changed.
waitingEventHTML5 mediaPlayback has stopped because of a temporary lack of data.
wheelWheelEventDOM L3A wheel button of a pointing device is rotated in any direction.

非标准事件

Event NameEvent TypeSpecificationFired when...
afterscriptexecuteEventMozilla SpecificA script has been executed.
beforescriptexecuteEventMozilla SpecificA script is about to be executed.
cardstatechange Firefox OS specificThe MozMobileConnection.cardStateproperty changes value.
changeDeviceStorageChangeEventFirefox OS specificThis event is triggered each time a file is created, modified or deleted on a given storage area.
connectionInfoUpdate Firefox OS specificThe informations about the signal strength and the link speed have been updated.
cfstatechange Firefox OS specificThe call forwarding state changes.
datachange Firefox OS specificThe MozMobileConnection.data object changes values.
dataerror Firefox OS specificThe MozMobileConnection.data object receive an error from theRIL.
DOMMouseScroll Mozilla specificThe wheel button of a pointing device is rotated (detail attribute is a number of lines). (use wheelinstead)
dragdropDragEventMozilla specificAn element is dropped (use drop instead).
dragexitDragEventMozilla specificA drag operation is being ended(use dragendinstead).
draggestureDragEventMozilla specificThe user starts dragging an element or text selection (use dragstart instead).
icccardlockerror Firefox OS specificthe MozMobileConnection.unlockCardLock()or MozMobileConnection.setCardLock()methods fails.
iccinfochange Firefox OS specificThe MozMobileConnection.iccInfo object changes.
localized Mozilla SpecificThe page has been localized using data-l10n-* attributes.
mousewheel IE inventedThe wheel button of a pointing device is rotated.
MozAudioAvailableEventMozilla specificThe audio buffer is full and the corresponding raw samples are available.
MozBeforeResize Mozilla specificA window is about to be resized.
mozbrowserclose Firefox OS specificSent when window.close() is called within a browser iframe.
mozbrowsercontextmenu Firefox OS specificSent when a browser `` try to open a context menu.
mozbrowsererror Firefox OS specificSent when an error occured while trying to load a content within a browser iframe
mozbrowsericonchange Firefox OS specificSent when the favicon of a browser iframe changes.
mozbrowserlocationchange Firefox OS specificSent when an browser iframe's location changes.
mozbrowserloadend Firefox OS specificSent when the browser iframe has finished loading all its assets.
mozbrowserloadstart Firefox OS specificSent when the browser iframe starts to load a new page.
mozbrowseropenwindow Firefox OS specificSent when window.open() is called within a browser iframe.
mozbrowsersecuritychange Firefox OS specificSent when the SSL state changes within a browser iframe.
mozbrowsershowmodalprompt Firefox OS specificSent when alert(), confirm() or prompt() are called within a browser iframe
mozbrowsertitlechange Firefox OS specificSent when the document.title changes within a browser iframe.
MozGamepadButtonDown To be specifiedA gamepad button is pressed down.
MozGamepadButtonUp To be specifiedA gamepad button is released.
MozMousePixelScroll Mozilla specificThe wheel button of a pointing device is rotated (detail attribute is a number of pixels). (use wheel instead)
MozOrientation Mozilla specificFresh data is available from an orientation sensor (see deviceorientation).
MozScrolledAreaChangedUIEventMozilla specificThe document view has been scrolled or resized.
moztimechange Mozilla specificThe time of the device has been changed.
MozTouchDown Mozilla specificA touch point is placed on the touch surface (use touchstart instead).
MozTouchMove Mozilla specificA touch point is moved along the touch surface (use touchmove instead).
MozTouchUp Mozilla specificA touch point is removed from the touch surface (use touchend instead).
alertingCallEventTo be specifiedThe correspondent is being alerted (his/her phone is ringing).
busyCallEventTo be specifiedThe line of the correspondent is busy.
callschangedCallEventTo be specifiedA call has been added or removed from the list of current calls.
onconnectedconnectedCallEventTo be specifiedA call has been connected.
connectingCallEventTo be specifiedA call is about to connect.
deliveredSMSEventTo be specifiedAn SMS has been successfully delivered.
dialingCallEventTo be specifiedThe number of a correspondent has been dialed.
disabled Firefox OS specificWifi has been disabled on the device.
disconnectedCallEventTo be specifiedA call has been disconnected.
disconnectingCallEventTo be specifiedA call is about to disconnect.
enabled Firefox OS specificWifi has been enabled on the device.
errorCallEventTo be specifiedAn error occurred.
heldCallEventTo be specifiedA call has been held.
holdingCallEventTo be specifiedA call is about to be held.
incomingCallEventTo be specifiedA call is being received.
receivedSMSEventTo be specifiedAn SMS has been received.
resumingCallEventTo be specifiedA call is about to resume.
sentSMSEventTo be specifiedAn SMS has been sent.
statechangeCallEventTo be specifiedThe state of a call has changed.
statuschange Firefox OS specificThe status of the Wifi connection changed.
overflowUIEventMozilla specificAn element has been overflowed by its content or has been rendered for the first time in this state (only works for elements styled withoverflow!=visible).
smartcard-insert Mozilla specificAsmartcardhas been inserted.
smartcard-remove Mozilla specificAsmartcardhas been removed.
stkcommand Firefox OS specificTheSTKProactive Command is issued fromICC.
stksessionend Firefox OS specificTheSTKSession is terminated byICC.
text Mozilla SpecificA generic composition event occurred.
underflowUIEventMozilla specificAn element is no longer overflowed by its content (only works for elements styled withoverflow!=visible).
uploadprogressProgressEventMozilla SpecificUpload is in progress (see progress).
ussdreceived Firefox OS specificA newUSSDmessage is received
voicechange Firefox OS specificThe MozMobileConnection.voice object changes values.

Mozilla 特定事件

注意:这些事件不会暴露给 Web 内容使用,只能在 chrome 内容的上下文中使用。

XUL 事件

Event NameEvent TypeSpecificationFired when...
broadcast XULAnobservernoticed a change to the attributes of a watched broadcaster.
CheckboxStateChange XULThe state of acheckboxhas been changed either by a user action or by a script (useful for accessibility).
close XULThe close button of the window has been clicked.
command XULAn element has been activated.
commandupdate XULA command update occurred on acommandsetelement.
DOMMenuItemActive XULA menu or menuitem has been hovered or highlighted.
DOMMenuItemInactive XULA menu or menuitem is no longer hovered or highlighted.
popuphiddenPopupEventXULA menupopup, panel or tooltip has been hidden.
popuphidingPopupEventXULA menupopup, panel or tooltip is about to be hidden.
popupshowingPopupEventXULA menupopup, panel or tooltip is about to become visible.
popupshownPopupEventXULA menupopup, panel or tooltip has become visible.
RadioStateChange XULThe state of aradiohas been changed either by a user action or by a script (useful for accessibility).
ValueChange XULThe value of an element has changed (a progress bar for example, useful for accessibility).

附加组件特定事件

Event NameEvent TypeSpecificationFired when...
MozSwipeGesture Addons specificA touch point is swiped across the touch surface
MozMagnifyGestureStart Addons specificTwo touch points start to move away from each other.
MozMagnifyGestureUpdate Addons specificTwo touch points move away from each other (after a MozMagnifyGestureStart).
MozMagnifyGesture Addons specificTwo touch points moved away from each other (after a sequence of MozMagnifyGestureUpdate).
MozRotateGestureStart Addons specificTwo touch points start to rotate around a point.
MozRotateGestureUpdate Addons specificTwo touch points rotate around a point (after a MozRotateGestureStart).
MozRotateGesture Addons specificTwo touch points rotate around a point (after a sequence of MozRotateGestureUpdate).
MozTapGesture Addons specificTwo touch points are tapped on the touch surface.
MozPressTapGesture Addons specificA "press-tap" gesture happened on the touch surface (first finger down, second finger down, second finger up, first finger up).
MozEdgeUIGesture Addons specificA touch point is swiped across the touch surface to invoke the edge UI (Win8 only).
MozAfterPaint Addons specificContent has been repainted.
DOMPopupBlocked Addons specificA popup has been blocked
DOMWindowCreated Addons specificA window has been created.
DOMWindowClose Addons specificA window is about to be closed.
DOMTitleChanged Addons specifcThe title of a window has changed.
DOMLinkAdded Addons specifcA link has been added a document.
DOMLinkRemoved Addons specifcA link has been removed inside from a document.
DOMMetaAdded Addons specificAmetaelement has been added to a document.
DOMMetaRemoved Addons specificAmetaelement has been removed from a document.
DOMWillOpenModalDialog Addons specificA modal dialog is about to open.
DOMModalDialogClosed Addons specificA modal dialog has been closed.
DOMAutoComplete Addons specificThe content of an element has been auto-completed.
DOMFrameContentLoaded Addons specificThe frame has finished loading (but not its dependent resources).
AlertActive Addons specificAnotificationelement is shown.
AlertClose Addons specificAnotificationelement is closed.
fullscreen Addons specificBrowser fullscreen mode has been entered or left.
sizemodechange Addons specificWindow has entered/left fullscreen mode, or has been minimized/unminimized.
MozEnteredDomFullscreen Addons specificDOM fullscreenmode has been entered.
SSWindowClosing Addons specificThe session store will stop tracking this window.
SSTabClosing Addons specificThe session store will stop tracking this tab.
SSTabRestoring Addons specificA tab is about to be restored.
SSTabRestored Addons specificA tab has been restored.
SSWindowStateReady Addons specificA window state has switched to "ready".
SSWindowStateBusy Addons specificA window state has switched to "busy".
tabviewsearchenabled Addons specificThe search feature of Panorama has been activated
tabviewsearchdisabled Addons specificThe search feature of Panorama has been deactivated
tabviewframeinitialized Addons specificThe frame container of Panorama has been initialized
tabviewshown Addons specificThe Panorama tab has been shown
tabviewhidden Addons specificThe Panorama tab has been hidden
TabOpen Addons specificA tab has been opened.
TabClose Addons specificA tab has been closed.
TabSelect Addons specificA tab has been selected.
TabShow Addons specificA tab has been shown.
TabHide Addons specificA tab has been hidden.
TabPinned Addons specificA tab has been pinned.
TabUnpinned Addons specificA tab has been unpinned.

开发者工具特定事件

Event NameEvent TypeSpecificationFired when...
CssRuleViewRefreshed devtools specificThe "Rules" view of the style inspector has been updated.
CssRuleViewChanged devtools specificThe "Rules" view of the style inspector has been changed.
CssRuleViewCSSLinkClicked devtools specificA link to a CSS file has been clicked in the "Rules" view of the style inspector.
  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值