mail us  |  mail this page

products  |  company  |  support  |  downloads  |  isp services  |  contact us

Tech Info - DOM-2 Events

W3C Event Reference. Part of the Events Interface.

Events

The following notes apply:

  1. Events bubble UP. Event listeners may be registered at various levels in the object hierarchy for the same event.
  2. Events may be canceled at any level (if allowed).
  3. We use the terms properties - W3C use the term attributes.
  4. We use the term object - W3C use the term element.
  5. EventTarget is the object in object.addEventListener(params).
  6. DOM-2 does not define keyboard events.
  7. Mutation events are triggered when the page is changed.

Event Properties

The following properties (attributes) are exposed when an event is triggered (an event object is created). ALL properties (attributes) below are READ ONLY.

Property Description
altKey boolean - true if alt key pressed
button 0 = right, 1 = middle, 2 = left. More than one button may be indicated. In Gecko not valid on mousemove, mouseout, mouseover.
clientX the horizontal offset in pixels from the parent node of this object.
clientY the vertical offset in pixels from the parent node of this object.
ctrlKey boolean - true = control key pressed.
metaKey boolean true = meta key pressed.
relatedTarget on 'mouseover' should be object being exited. For 'mouseout' should be the object being entered.
screenX the horizontal offset in pixels from the origin of the screen.
screenY the vertical offset in pixels from the origin of the screen.
shiftKey boolean true = shift key was pressed.
bubbles boolean true = event can bubble.
cancelable boolean true = event can be canceled.
currentTarget the name of the object currently being processed.
eventPhase may be:
AT_TARGET - evaluation (being initialised)
BUBBLING_PHASE
CAPTURING_PHASE.
target indicates the target to which the event was originally dispatched.
timeStamp time in milliseconds from 1st January 1970 (UCT) or 0 if not available.
type the name of the event.
detail event specific details.
view identifies the AbstractView for the event (?).
attrChange Mutation. Indicates the type of change may be: ADDITION, MODIFICATION, REMOVAL.
attrName Mutation. The name of object that changed.
newValue Mutation. The new value of the object.
prevValue Mutation. The previous value of the object.
relatedNode Mutation. Indicates the actual node changed if an indirect event was created (the event was triggered by a change to another node which may be higher or lower in the hierarchy).

Event Methods

The following methods are exposed when an event is triggered (an event object is created).

Method Description
addEventListener adds an event listener for the defined event type for the specified object.
dispatchevent fires an event created by a createEvent followed by an initEvent.
removeEventListener removes an event listener for the defined event type for the specified object.
initEvent initialises an event that is subsequently fired by the dispatchEvent method.
preventDefault stops the event bubbling (this lets you stop the default context menu on right mouse click).
stopPropagation stops further event triggering at higher levels in the object hierarchy (this lets you stop the default context menu on right mouse click).
createEvent called as part of a sequence to fire an event createEvent->initMouseEvent->dispatchevent.
initUIEvent initialises a UI event that is subsequently fired by the dispatchEvent method.
initMouseEvent initialises a Mouse event that is subsequently fired by the dispatchEvent method.
initMutationEvent initialises a Mutation event that is subsequently fired by the dispatchEvent method.


Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.

Tech

tech home
audio stuff
web stuff
dom stuff
css stuff
language stuff
regex stuff
rfc stuff
protocol stuff
cable stuff
lan wiring
rs232 wiring
howto stuff
survival stuff
wireless stuff
ascii codes
data rate stuff
telephony stuff
mechanical stuff
pc stuff
electronic stuff
tech links
open guides
RSS Feed Icon RSS Feed

If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C STANDARDS COMPLIANT browser such as Mozilla

web zytrax.com



HTML Stuff

W3C HTML 4.01
HTML5 (WHATWG)
HTML4 vs HTML5
HTML5 Reference
W3C Page Validator
W3C DOCTYPE

CSS Stuff

W3C CSS1
W3C CSS2.1

DOM Stuff

W3C DOM
W3C DOM Events
Gecko DOM
MSIE DOM

Usability/Access

usability.gov
W3C -WAI
Web Style Guide
Michael L Bernard
WebAim.org

Jolly Useful

Peter-Paul Koch
A List Apart
Eric Meyer on CSS
glish.com
DOCTYPE definitions

Our Stuff

Our DOM Pages
DOM User Guide
DOM Explorer
DOM Navigation
CSS Short Cuts
CSS Techniques
CSS overview
Oh Really!

Javascript

ECMA-262

Pop-out Menus

webmasterbase.com
Brainjar Menubar
Our Lite JS Menus
Our CSS Menus
Tigra Menus

printer friendly

Print Page

SPF Record Conformant Domain Logo

Copyright © 1994 - 2010 ZyTrax, Inc.
All rights reserved. Legal and Privacy
site by zytrax
Hosted by super.net.sg
web-master at zytrax
Page modified: May 24 2007.