The Navigator Event Model: Navigator 4.0x's New and Revised Events - Doc JavaScript | WebReference

The Navigator Event Model: Navigator 4.0x's New and Revised Events - Doc JavaScript


Navigator 4.0x's New and Revised Events

In this section we'll present the new and revised events in Netscape Navigator 4.0x. Pre-Navigator 4.0 events that are not listed on this page utilize only the type and target properties of the event object.

Note that Navigator 4.0x recognizes mixed-case and lowercase use of events and event handlers. For example, object.onClick and object.onclick are both valid. We'll use the all-lowercase notation. Now here's the complete list of new and revised events in Navigator 4.0x:

click

Event click
Event Handler onclick
Event of... document, button, checkbox, link, radio, reset, submit
Properties type, target, which, modifiers
When a link is clicked: layerX, layerY, pageX, pageY, screenX, screenY
When a button is clicked, none of these properties are available.
Description Occurs when the user clicks a link, a form element, or any other element that supports this event (see "Event of..."). If the event handler returns false, the default action of the object is cancelled. For buttons, there is no default action, so nothing is cancelled. For radio buttons and checkboxes, nothing is set. For a submit button, the form is not submitted, and for a reset button, it's not reset. In Navigator 3.0, on some platforms, returning false in an onclick event handler for a reset button has no effect.

dblclick

Event dblclick
Event Handler ondblclick
Event of... document, area, link
Properties type, target, which, modifiers, layerX, layerY, pageX, pageY, screenX, screenY
Description Occurs when the user double-clicks a form element or a link. dblclick is not implemented on the Macintosh version of Netscape Navigator 4.0x.

dragdrop

Event dragdrop
Event Handler ondragdrop
Event of... window
Properties type, target, data
Description Occurs when the user drops a system item (file, shortcut, etc.) onto the browser window via the native system's drag and drop mechanism. The browser's normal response is to attempt to load the item into the window. If the event handler returns false, the drag and drop operation is cancelled.

keydown

Event keydown
Event Handler onkeydown
Event of... document, image, link, textarea
Properties type, target, modifiers, layerX, layerY, pageX, pageY, screenX, screenY, which
Description Occurs when the key reaches the bottom of its physical travel. In other words, this event occurs when the user depresses a key. If the event handler returns false, the event is cancelled.

keypress

Event keypress
Event Handler onkeypress
Event of... document, image, link, textarea
Properties type, target, modifiers, layerX, layerY, pageX, pageY, screenX, screenY, which
Description Occurs immediately after a keydown if the onkeydown event handler doesn't return false. The keypress event fires when the user presses or holds down a key. A key is pressed when it is pushed down and then released, so keypress is actually the combination of keydown and keyup. When you hold down a key, the keypress event fires repeatedly, similar to the way typed characters auto-repeat after a brief delay on most computers.

keyup

Event keyup
Event Handler onkeyup
Event of... document, image, link, textarea
Properties type, target, modifiers, layerX, layerY, pageX, pageY, screenX, screenY, which
Description Occurs when the key starts its travel upward. In other words, this event occurs when the user releases a key.

mousedown

Event mousedown
Event Handler onmousedown
Event of... button, document, link
Properties type, target, modifiers, layerX, layerY, pageX, pageY, screenX, screenY, which
Description Occurs when the user depresses a mouse button. This event occurs before the user releases the mouse button. All mouse buttons trigger the event.

mousemove

Event mousemove
Event Handler onmousemove
Event of... window
Properties type, target, layerX, layerY, pageX, pageY, screenX, screenY
Description Occurs when the user moves the cursor. This event must be captured with the captureEvents() method, because its object is always a top-level one (window).

mouseout

Event mouseout
Event Handler onmouseout
Event of... area, layer, link
Properties type, target, layerX, layerY, pageX, pageY, screenX, screenY
Description Occurs when the user moves the cursor out of an object. A mouseover event noramlly occurs before a mouseout event.

mouseover

Event mouseover
Event Handler onmouseover
Event of... area, layer, link
Properties type, target, layerX, layerY, pageX, pageY, screenX, screenY
Description Occurs when the user moves the cursor over an object. When the user removes the cursor from the object, a mouseout event fires.

mouseup

Event mouseup
Event Handler onmouseup
Event of... button, document, link
Properties type, target, modifiers, layerX, layerY, pageX, pageY, screenX, screenY, which
Description Occurs when the user releases a mouse button. This event always follows a mousedown event, because a mouse button must be pressed before it's released.

move

Event move
Event Handler onmove
Event of... window
Properties type, target, screenX, screenY
Description Occurs when a window is moved by the user, or by a script. If the user maximizes or restores a window, the move event occurs because the widow's size changed.

resize

Event resize
Event Handler onresize
Event of... window
Properties type, target, width, height
Description Occurs when a window or frame is resized by the user, or by a script. When you resize a window, the browser firsts completes the new HTML layout within the new window's inner dimensions. Only then the resize event fires.

http://www.internet.com


Created: December 16, 1997
Revised: December 16, 1997

URL: http://www.webreference.com/js/column9/newevents.html