javascript事件与event对象的属性
javascript事件列表解说 | |||
事件 | 浏览器支持 | 解说 | |
一般事件 | onclick | IE3、N2 | 鼠标点击时触发此事件 |
ondblclick | IE4、N4 | 鼠标双击时触发此事件 | |
onmousedown | IE4、N4 | 按下鼠标时触发此事件 | |
onmouseup | IE4、N4 | 鼠标按下后松开鼠标时触发此事件 | |
onmouseover | IE3、N2 | 当鼠标移动到某对象范围的上方时触发此事件 | |
onmousemove | IE4、N4 | 鼠标移动时触发此事件 | |
onmouseout | IE4、N3 | 当鼠标离开某对象范围时触发此事件 | |
onkeypress | IE4、N4 | 当键盘上的某个键被按下并且释放时触发此事件. | |
onkeydown | IE4、N4 | 当键盘上某个按键被按下时触发此事件 | |
onkeyup | IE4、N4 | 当键盘上某个按键被按放开时触发此事件 | |
页面相关事件 | onabort | IE4、N3 | 图片在下载时被用户中断 |
onbeforeunload | IE4、N | 当前页面的内容将要被改变时触发此事件 | |
onerror | IE4、N3 | 出现错误时触发此事件 | |
onload | IE3、N2 | 页面内容完成时触发此事件 | |
onmove | IE、N4 | 浏览器的窗口被移动时触发此事件 | |
onresize | IE4、N4 | 当浏览器的窗口大小被改变时触发此事件 | |
onscroll | IE4、N | 浏览器的滚动条位置发生变化时触发此事件 | |
onstop | IE5、N | 浏览器的停止按钮被按下时触发此事件或者正在下载的文件被中断 | |
onunload | IE3、N2 | 当前页面将被改变时触发此事件 | |
表单相关事件 | onblur | IE3、N2 | 当前元素失去焦点时触发此事件 |
onchange | IE3、N2 | 当前元素失去焦点并且元素的内容发生改变而触发此事件 | |
onfocus | IE3 、N2 | 当某个元素获得焦点时触发此事件 | |
onreset | IE4 、N3 | 当表单中RESET的属性被激发时触发此事件 | |
onsubmit | IE3 、N2 | 一个表单被递交时触发此事件 | |
滚动字幕事件 | onbounce | IE4、N | 在Marquee内的内容移动至Marquee显示范围之外时触发此事件 |
onfinish | IE4、N | 当Marquee元素完成需要显示的内容后触发此事件 | |
onstart | IE4、 N | 当Marquee元素开始显示内容时触发此事件 | |
编辑事件 | onbeforecopy | IE5、N | 当页面当前的被选择内容将要复制到浏览者系统的剪贴板前触发此事件 |
onbeforecut | IE5、 N | 当页面中的一部分或者全部的内容将被移离当前页面[剪贴]并移动到浏览者的系统剪贴板时触发此事件 | |
onbeforeeditfocus | IE5、N | 当前元素将要进入编辑状态 | |
onbeforepaste | IE5、 N | 内容将要从浏览者的系统剪贴板传送[粘贴]到页面中时触发此事件 | |
onbeforeupdate | IE5、 N | 当浏览者粘贴系统剪贴板中的内容时通知目标对象 | |
oncontextmenu | IE5、N | 当浏览者按下鼠标右键出现菜单时或者通过键盘的按键触发页面菜单时触发的事件 | |
oncopy | IE5、N | 当页面当前的被选择内容被复制后触发此事件 | |
oncut | IE5、N | 当页面当前的被选择内容被剪切时触发此事件 | |
ondrag | IE5、N | 当某个对象被拖动时触发此事件 [活动事件] | |
ondragdrop | IE、N4 | 一个外部对象被鼠标拖进当前窗口或者帧 | |
ondragend | IE5、N | 当鼠标拖动结束时触发此事件,即鼠标的按钮被释放了 | |
ondragenter | IE5、N | 当对象被鼠标拖动的对象进入其容器范围内时触发此事件 | |
ondragleave | IE5、N | 当对象被鼠标拖动的对象离开其容器范围内时触发此事件 | |
ondragover | IE5、N | 当某被拖动的对象在另一对象容器范围内拖动时触发此事件 | |
ondragstart | IE4、N | 当某对象将被拖动时触发此事件 | |
ondrop | IE5、N | 在一个拖动过程中,释放鼠标键时触发此事件 | |
onlosecapture | IE5、N | 当元素失去鼠标移动所形成的选择焦点时触发此事件 | |
onpaste | IE5、N | 当内容被粘贴时触发此事件 | |
onselect | IE4、N | 当文本内容被选择时的事件 | |
onselectstart | IE4、N | 当文本内容选择将开始发生时触发的事件 | |
数据绑定 | onafterupdate | IE4、N | 当数据完成由数据源到对象的传送时触发此事件 |
oncellchange | IE5、N | 当数据来源发生变化时 | |
ondataavailable | IE4、N | 当数据接收完成时触发事件 | |
ondatasetchanged | IE4、N | 数据在数据源发生变化时触发的事件 | |
ondatasetcomplete | IE4、N | 当来子数据源的全部有效数据读取完毕时触发此事件 | |
onerrorupdate | IE4、N | 当使用onBeforeUpdate事件触发取消了数据传送时,代替onAfterUpdate事件 | |
onrowenter | IE5、N | 当前数据源的数据发生变化并且有新的有效数据时触发的事件 | |
onrowexit | IE5、N | 当前数据源的数据将要发生变化时触发的事件 | |
onrowsdelete | IE5、N | 当前数据记录将被删除时触发此事件 | |
onrowsinserted | IE5、N | 当前数据源将要插入新数据记录时触发此事件 | |
外部事件 | onafterprint | IE5、N | 当文档被打印后触发此事件 |
onbeforeprint | IE5、N | 当文档即将打印时触发此事件 | |
onfilterchange | IE4、N | 当某个对象的滤镜效果发生变化时触发的事件 | |
onhelp | IE4、N | 当浏览者按下F1或者浏览器的帮助选择时触发此事件 | |
onpropertychange | IE5、N | 当对象的属性之一发生变化时触发此事件 | |
onreadystatechange | IE4、N | 当对象的初始化属性值发生变化时触发此事件 |
event对象的属性
Abstract | Returns the Abstract content in an Advanced Stream Redirector (ASX) file
用 event 对象获取高级流重定向器(ASX)文件中项目横幅的 Abstract 内容。 |
altKey | Sets or returns a Boolean value that indicates the state of the ALT key
设置或获取 Alt 键的状态。 |
altLeft | Returns a Boolean value that indicates the state of the left ALT key
设置或获取左 Alt 键的状态。 |
banner | Returns the Banner content in an ASX file
使用 event 对象获取高级流重定向器(ASX)文件中项目的 Banner 内容。 |
button | Sets or returns the mouse button pressed by the user
设置或获取用户所按的鼠标按钮。
|
cancelBubble | Sets or returns a Boolean value that indicates whether or not the current event should bubble up the hierarchy of event handlers
设置或获取当前事件是否要在事件句柄中向上冒泡。 |
clientX | Sets or returns the x-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars
设置或获取鼠标指针位置相对于窗口客户区域的 x 坐标,其中客户区域不包括窗口自身的控件和滚动条。 |
clientY | Sets or returns the y-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars
设置或获取鼠标指针位置相对于窗口客户区域的 y 坐标,其中客户区域不包括窗口自身的控件和滚动条。 |
contentOverflow | 获取表明文档处理当前 LayoutRect 对象后是否包含附加的内容。 |
ctrlKey | Sets or returns a Boolean value that indicates the state of the CTRL key
设置或获取 Ctrl 键的状态。 |
ctrlLeft | Sets or returns a Boolean value that indicates the state of the left CTRL key
设置或获取左 Ctrl 键的状态。 |
dataFld | Sets or returns the data column affected by the oncellchange event
设置或获取 oncellchange 事件影响的数据列。 |
fromElement | Sets or returns the object from which activation or the mouse pointer is exiting during the event
设置或获取事件发生时激活或鼠标将要离开的对象。 |
keyCode | Sets or returns the UNICODE of the key pressed
设置或获取与导致事件的按键关联的 Unicode 按键代码。 |
MoreInfo | Returns the MoreInfo content in an ASX file
通过 event 对象获取高级流重定向器(ASX)文件中项目横幅的 MoreInfo 内容。 |
nextPage | Returns the position of the next page within a print template
获取打印模板中下页的位置。 |
offsetX | Sets or returns the x-coordinate of the mouse pointer relative to the object firing the event
设置或获取鼠标指针位置相对于触发事件的对象的 x 坐标。 |
offsetY | Sets or returns the y-coordinate of the mouse pointer relative to the object firing the event
设置或获取鼠标指针位置相对于触发事件的对象的 y 坐标。 |
propertyName | Sets or returns the name of the property that has changed on the object
设置或获取对象上发生更改的属性名称。 |
qualifier | 设置或获取由数据源对象提供的数据成员的名称。 |
reason | Sets or returns the result of a data transfer for a data source
设置或获取数据源对象的数据传输结果。
|
recordset | Sets or returns a reference to the default record set in a data source
从数据源对象设置或获取对默认数据集的引用。 |
repeat | Returns a Boolean value that indicates whether the ONKEYDOWN event is being repeated
获取 onkeydown 事件是否正在重复。 |
returnValue | Sets or returns the return value from an event
设置或获取事件的返回值。 |
saveType | Returns the clipboard type when ONCONTENTSAVE fires
当 oncontentsave 触发时获取剪贴板类型。 |
screenX | Sets or returns the x-coordinate of the mouse pointer - relative to the screen
设置或获取获取鼠标指针位置相对于用户屏幕的 x 坐标。 |
screenY | Sets or returns the y-coordinate of the mouse pointer - relative to the screen
设置或获取鼠标指针位置相对于用户屏幕的 y 坐标。 |
shiftKey | Returns a Boolean value that indicates the state of the SHIFT key
设置或获取 Shift 键的状态。 |
shiftLeft | Returns a Boolean value that indicates the state of the left SHIFT key
设置或获取左 Shift 键的状态。 |
srcElement | Sets or returns the object that fired the event
设置或获取触发事件的对象。 |
srcFilter | Sets or returns the filter object that fired the ONFILTERCHANGE event
设置或获取触发 onfilterchange 事件的滤镜对象。 |
srcUrn | Sets or returns the Universal Resource Name (URN) of the behavior that fired the event
获取触发事件的行为的统一资源名称(URN)。 |
toElement | Sets or returns a reference to the object toward which the user is moving the mouse pointer
设置或获取用户要将鼠标指针移动指向的对象的引用。 |
type | Sets or returns the event name
从 event 对象中获取事件名称。 |
wheelDelta | Returns the distance and the direction the wheel button has rolled
设置或获取滚轮按钮滚动的距离和方向。 |
x | Sets or returns the x-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element
设置或获取鼠标指针位置相对于父文档的 x 像素坐标。 |
y | Sets or returns the y-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element
设置或获取鼠标指针位置相对于父文档的 y 像素坐标。 |