javascript事件与event对象的属性

javascript事件列表解说
事件浏览器支持解说
一般事件onclickIE3、N2鼠标点击时触发此事件
ondblclickIE4、N4鼠标双击时触发此事件
onmousedownIE4、N4按下鼠标时触发此事件
onmouseupIE4、N4鼠标按下后松开鼠标时触发此事件
onmouseoverIE3、N2当鼠标移动到某对象范围的上方时触发此事件
onmousemoveIE4、N4鼠标移动时触发此事件
onmouseoutIE4、N3当鼠标离开某对象范围时触发此事件
onkeypressIE4、N4当键盘上的某个键被按下并且释放时触发此事件.
onkeydownIE4、N4当键盘上某个按键被按下时触发此事件
onkeyupIE4、N4当键盘上某个按键被按放开时触发此事件
页面相关事件onabortIE4、N3图片在下载时被用户中断
onbeforeunloadIE4、N当前页面的内容将要被改变时触发此事件
onerrorIE4、N3出现错误时触发此事件
onloadIE3、N2页面内容完成时触发此事件
onmoveIE、N4浏览器的窗口被移动时触发此事件
onresizeIE4、N4当浏览器的窗口大小被改变时触发此事件
onscrollIE4、N浏览器的滚动条位置发生变化时触发此事件
onstopIE5、N浏览器的停止按钮被按下时触发此事件或者正在下载的文件被中断
onunloadIE3、N2当前页面将被改变时触发此事件
表单相关事件onblurIE3、N2当前元素失去焦点时触发此事件
onchangeIE3、N2当前元素失去焦点并且元素的内容发生改变而触发此事件
onfocusIE3 、N2当某个元素获得焦点时触发此事件
onresetIE4 、N3当表单中RESET的属性被激发时触发此事件
onsubmitIE3 、N2一个表单被递交时触发此事件
滚动字幕事件onbounceIE4、N在Marquee内的内容移动至Marquee显示范围之外时触发此事件
onfinishIE4、N当Marquee元素完成需要显示的内容后触发此事件
onstartIE4、 N当Marquee元素开始显示内容时触发此事件
编辑事件onbeforecopyIE5、N当页面当前的被选择内容将要复制到浏览者系统的剪贴板前触发此事件
onbeforecutIE5、 N当页面中的一部分或者全部的内容将被移离当前页面[剪贴]并移动到浏览者的系统剪贴板时触发此事件
onbeforeeditfocusIE5、N当前元素将要进入编辑状态
onbeforepasteIE5、 N内容将要从浏览者的系统剪贴板传送[粘贴]到页面中时触发此事件
onbeforeupdateIE5、 N当浏览者粘贴系统剪贴板中的内容时通知目标对象
oncontextmenuIE5、N当浏览者按下鼠标右键出现菜单时或者通过键盘的按键触发页面菜单时触发的事件
oncopyIE5、N当页面当前的被选择内容被复制后触发此事件
oncutIE5、N当页面当前的被选择内容被剪切时触发此事件
ondragIE5、N当某个对象被拖动时触发此事件 [活动事件]
ondragdropIE、N4一个外部对象被鼠标拖进当前窗口或者帧
ondragendIE5、N当鼠标拖动结束时触发此事件,即鼠标的按钮被释放了
ondragenterIE5、N当对象被鼠标拖动的对象进入其容器范围内时触发此事件
ondragleaveIE5、N当对象被鼠标拖动的对象离开其容器范围内时触发此事件
ondragoverIE5、N当某被拖动的对象在另一对象容器范围内拖动时触发此事件
ondragstartIE4、N当某对象将被拖动时触发此事件
ondropIE5、N在一个拖动过程中,释放鼠标键时触发此事件
onlosecaptureIE5、N当元素失去鼠标移动所形成的选择焦点时触发此事件
onpasteIE5、N当内容被粘贴时触发此事件
onselectIE4、N当文本内容被选择时的事件
onselectstartIE4、N当文本内容选择将开始发生时触发的事件
数据绑定onafterupdateIE4、N当数据完成由数据源到对象的传送时触发此事件
oncellchangeIE5、N当数据来源发生变化时
ondataavailableIE4、N当数据接收完成时触发事件
ondatasetchangedIE4、N数据在数据源发生变化时触发的事件
ondatasetcompleteIE4、N当来子数据源的全部有效数据读取完毕时触发此事件
onerrorupdateIE4、N当使用onBeforeUpdate事件触发取消了数据传送时,代替onAfterUpdate事件
onrowenterIE5、N当前数据源的数据发生变化并且有新的有效数据时触发的事件
onrowexitIE5、N当前数据源的数据将要发生变化时触发的事件
onrowsdeleteIE5、N当前数据记录将被删除时触发此事件
onrowsinsertedIE5、N当前数据源将要插入新数据记录时触发此事件
外部事件onafterprintIE5、N当文档被打印后触发此事件
onbeforeprintIE5、N当文档即将打印时触发此事件
onfilterchangeIE4、N当某个对象的滤镜效果发生变化时触发的事件
onhelpIE4、N当浏览者按下F1或者浏览器的帮助选择时触发此事件
onpropertychangeIE5、N当对象的属性之一发生变化时触发此事件
onreadystatechangeIE4、N当对象的初始化属性值发生变化时触发此事件

event对象的属性

AbstractReturns the Abstract content in an Advanced Stream Redirector (ASX) file

event 对象获取高级流重定向器(ASX)文件中项目横幅的 Abstract 内容。

altKeySets or returns a Boolean value that indicates the state of the ALT key

设置或获取 Alt 键的状态。

altLeftReturns a Boolean value that indicates the state of the left ALT key

设置或获取左 Alt 键的状态。

bannerReturns the Banner content in an ASX file

使用 event 对象获取高级流重定向器(ASX)文件中项目的 Banner 内容。

buttonSets or returns the mouse button pressed by the user

设置或获取用户所按的鼠标按钮。

  • 0 - Default. No button pressed

    默认。没有按钮被按

  • 1 - Left button pressed

    左按钮被按了

  • 2 - Right button pressed

    右按钮被按了

  • 3 - Left and right buttons pressed

    左和右按钮被同时按了

  • 4 - Middle button pressed

    中间的按钮被按了

  • 5 - Left and middle buttons pressed

    左和中这俩按钮被按了

  • 6 - Right and middle buttons pressed

    右和中这俩按钮被按了

  • 7 - All three buttons are pressed

    所有三个按钮同时被按

    firefox(版本2.0) 点击鼠标左中右键, event.button的值分别为0,1,2

    IE(版本6) 点击鼠标左中右键, event.button的值分别为 1,2,4

    参见:http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent

cancelBubbleSets or returns a Boolean value that indicates whether or not the current event should bubble up the hierarchy of event handlers

设置或获取当前事件是否要在事件句柄中向上冒泡。

clientXSets or returns the x-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars

设置或获取鼠标指针位置相对于窗口客户区域的 x 坐标,其中客户区域不包括窗口自身的控件和滚动条。

clientYSets or returns the y-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars

设置或获取鼠标指针位置相对于窗口客户区域的 y 坐标,其中客户区域不包括窗口自身的控件和滚动条。

contentOverflow获取表明文档处理当前 LayoutRect 对象后是否包含附加的内容。
ctrlKeySets or returns a Boolean value that indicates the state of the CTRL key

设置或获取 Ctrl 键的状态。

ctrlLeftSets or returns a Boolean value that indicates the state of the left CTRL key

设置或获取左 Ctrl 键的状态。

dataFldSets or returns the data column affected by the oncellchange event

设置或获取 oncellchange 事件影响的数据列。

fromElementSets or returns the object from which activation or the mouse pointer is exiting during the event

设置或获取事件发生时激活或鼠标将要离开的对象。

keyCodeSets or returns the UNICODE of the key pressed

设置或获取与导致事件的按键关联的 Unicode 按键代码。

MoreInfoReturns the MoreInfo content in an ASX file

通过 event 对象获取高级流重定向器(ASX)文件中项目横幅的 MoreInfo 内容。

nextPageReturns the position of the next page within a print template

获取打印模板中下页的位置。

offsetXSets or returns the x-coordinate of the mouse pointer relative to the object firing the event

设置或获取鼠标指针位置相对于触发事件的对象的 x 坐标。

offsetYSets or returns the y-coordinate of the mouse pointer relative to the object firing the event

设置或获取鼠标指针位置相对于触发事件的对象的 y 坐标。

propertyNameSets or returns the name of the property that has changed on the object

设置或获取对象上发生更改的属性名称。

qualifier设置或获取由数据源对象提供的数据成员的名称。
reasonSets or returns the result of a data transfer for a data source

设置或获取数据源对象的数据传输结果。

  • 0 - Successfully

    成功的

  • 1 - Aborted

    放弃的

  • 2 - Error

    错误的

recordsetSets or returns a reference to the default record set in a data source

从数据源对象设置或获取对默认数据集的引用。

repeatReturns a Boolean value that indicates whether the ONKEYDOWN event is being repeated

获取 onkeydown 事件是否正在重复。

returnValueSets or returns the return value from an event

设置或获取事件的返回值。

saveTypeReturns the clipboard type when ONCONTENTSAVE fires

当 oncontentsave 触发时获取剪贴板类型。

screenXSets or returns the x-coordinate of the mouse pointer - relative to the screen

设置或获取获取鼠标指针位置相对于用户屏幕的 x 坐标。

screenYSets or returns the y-coordinate of the mouse pointer - relative to the screen

设置或获取鼠标指针位置相对于用户屏幕的 y 坐标。

shiftKeyReturns a Boolean value that indicates the state of the SHIFT key

设置或获取 Shift 键的状态。

shiftLeftReturns a Boolean value that indicates the state of the left SHIFT key

设置或获取左 Shift 键的状态。

srcElementSets or returns the object that fired the event

设置或获取触发事件的对象。

srcFilterSets or returns the filter object that fired the ONFILTERCHANGE event

设置或获取触发 onfilterchange 事件的滤镜对象。

srcUrnSets or returns the Universal Resource Name (URN) of the behavior that fired the event

获取触发事件的行为的统一资源名称(URN)。

toElementSets or returns a reference to the object toward which the user is moving the mouse pointer

设置或获取用户要将鼠标指针移动指向的对象的引用。

typeSets or returns the event name

从 event 对象中获取事件名称。

wheelDeltaReturns the distance and the direction the wheel button has rolled

设置或获取滚轮按钮滚动的距离和方向。

xSets or returns the x-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element

设置或获取鼠标指针位置相对于父文档的 x 像素坐标。

ySets or returns the y-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element

设置或获取鼠标指针位置相对于父文档的 y 像素坐标。