1. 首页
  2. 课程学习
  3. Java
  4. Event对象详解

Event对象详解

上传者: 2018-12-28 10:51:24上传 DOCX文件 24.06KB 热度 45次
event代表事件的状态,例如触发event对象的元素、鼠标的位置及状态、按下的键等等。 event对象只在事件发生的过程中才有效。 event的某些属性只对特定的事件有意义。比如,fromElement 和 toElement 属性只对 onmouseover 和 onmouseout 事件有意义。 例子 下面的例子检查鼠标是否在链接上单击,并且,如果shift键被按下,就取消链接的跳转。 Cancels Links function cancelLink() { if (window.event.srcElement.tagName == "A" && window.event.shiftKey) window.event.returnValue = false; } 下面的例子在状态栏上显示鼠标的当 前位置。 属性: altKey, button, cancelBubble, clientX, clientY, ctrlKey, fromElement, keyCode, offsetX, offsetY, propertyName, returnValue, screenX, screenY, shiftKey, srcElement, srcFilter, toElement, type, x, y 前位置。 属性: altKey, button, cancelBubble, clientX, clientY, ctrlKey, fromElement, keyCode, offsetX, offsetY, propertyName, returnValue, screenX, screenY, shiftKey, srcElement, srcFilter, toElement, type, x, y
下载地址
用户评论
码姐姐匿名网友 2018-12-28 10:51:24

很详细,事件触发状态机,可是参考一下