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
设置或获取用户所按的鼠标按钮。

  • 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

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
设置或获取数据源对象的数据传输结果。

  • 0 - Successfully
    成功的
  • 1 - Aborted
    放弃的
  • 2 - Error
    错误的
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 像素坐标。

javascript事件与event对象的属性的更多相关文章

  1. Javascript防冒泡事件与Event对象

    防冒泡 防冒泡用到的就是event的属性和方法 function add2shop(e) { if (!e) var e = window.event; e.cancelBubble = true; ...

  2. javascript:delete 删除对象的属性

    delete 运算符删除对以前定义的对象属性或方法的引用. 不可以删除的如下: 1通过var定义的变量 var a=1;delete a//false 2 声明后的函数 function a(){}; ...

  3. 使用 JavaScript 中的 document 对象的属性,根据下拉框中选择的属性,更改页面中的字体颜色和背景颜色

    查看本章节 查看作业目录 需求说明: 使用 JavaScript 中的 document 对象的属性,根据下拉框中选择的属性,更改页面中的字体颜色和背景颜色 实现思路: 在页面的 <body&g ...

  4. javascript高级程序设计---Event对象

    事件是一种异步编程的实现方式,本质上是程序各个组成部分之间传递的特定消息. DOM的事件操作(监听和触发),都定义在EventTarget接口 该接口就是三个方法,addEventListener和r ...

  5. Event 对象的属性和方法

    事件触发时,会将一个 Event 对象传递给事件处理程序,比如: document.getElementById("testText").addEventListener(&quo ...

  6. dom事件与event对象总结

    1 事件:就是文档或浏览器窗口中发生的一些特定的交互瞬间.    tips:js和xhtml的交互是通过当用户或浏览器操作网页时发生的事件来处理的. 1.1 事件流:即事件的顺序.        事件 ...

  7. javascript高级程序设计---Event对象三

    进度事件 进度事件用来描述一个事件进展的过程,比如XMLHttpRequest对象发出的HTTP请求的过程.<img>.<audio>.<video>.<st ...

  8. javascript高级程序设计---Event对象二

    鼠标事件 事件种类 鼠标事件指与鼠标相关的事件,主要有以下一些. (1)click事件 click事件当用户在Element节点.document节点.window对象上,单击鼠标(或者按下回车键)时 ...

  9. JavaScript事件循环(Event Loop)机制

    JavaScript 是单线程单并发语言 什么是单线程 主程序只有一个线程,即同一时间片断内其只能执行单个任务. 为什么选择单线程? JavaScript的主要用途是与用户互动,以及操作DOM.这决定 ...

随机推荐

  1. 160809209_李梦鑫_C语言程序设计实验2 选择结构程序设计

    实验2-1 输入3个数,并按由大到小的顺序输出. 实验要求: 编写一个C程序,输入3个数,并按由大到小的顺序输出. 源码:#include <stdio.h> int main() { i ...

  2. 一个CMS案例实战讲解PHP代码审计入门

    前言 php代码审计介绍:顾名思义就是检查php源代码中的缺点和错误信息,分析并找到这些问题引发的安全漏洞. 1.环境搭建: 工欲善其事必先利其器,先介绍代码审计必要的环境搭建 审计环境 window ...

  3. 国外开源的PACS服务器

    国外开源的PACS服务器 罗朝辉(http://www.cnblogs.com/kesalin/) 本文遵循"署名-非商业用途-保持一致"创作公用协议 名称:Dcm4che评级:★ ...

  4. 转:shell杀死指定名称的进程

    #!/bin/sh #根据进程名杀死进程 ] then echo "缺少参数:procedure_name" exit fi PROCESS=`|grep -v grep|grep ...

  5. Service错误

    错误日志:  Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act= ...

  6. js数组转置

    <script type="text/javascript">     var arr=[[1,2,3],[4,5,6],[7,8,9],[17,18,19]];    ...

  7. MySQL主从复制数据不一致问题【自增主键】

    前言: 今天遇到主从表不一致的情况,很奇怪为什么会出现不一致的情况,因为复制状态一直都是正常的.最后检查出现不一致的数据都是主键,原来是当时初始化数据的时候导致的.现在分析记录下这个问题,避免以后再遇 ...

  8. iOS SHA1加密实现方法

    使用方法 先导入头文件 #import "SHA1.h" //SHA1测试 NSString* sh1=[SHA1 getSha1String:"]; NSLog(@&q ...

  9. a byte of python(摘02)

    a byte of python 第四章 运算符与表达式 运算符 运算符优先级 (运算符通常由左向右结合,即具有相同优先级的运算符按照从左向右的顺序计算.例如, 2 + 3 + 4 被计算成 (2 + ...

  10. inline函数的用法

    在c/c++中,为了解决一些频繁调用的小函数大量消耗栈空间或是叫栈内存的问题,特别的引入了inline修饰符,表示为内联函数.栈空间就是指放置程式的局部数据也就是函数内数据的内存空间,在系统下,栈空间 ...