Appendix C. JavaScript Event Handlers


In the Behaviors panel, Dreamweaver lists the JavaScript event handler that controls the behavior's activation. To help you figure out exactly what is happening on your page and when, or to set the behavior to fire under different circumstances, please see the following table.

This table lists the most common and reliable JavaScript eventsthe ones that tend to work across browsers and devices. Depending upon your Dreamweaver settings, the Behaviors panel may offer a great many other JavaScript events from which to choose. You should probably avoid the ones that don't appear in this table, because they often lead to compatibility problems.

As always, be sure to test your behaviors in several different live browsers before you upload your pages, even if you pick from the safe choices. Not all browsers support all events under exactly the same set of circumstances.

Table C-1.

Event

Fires when

onAbort

The visitor stops an image from downloading

onBlur

The element loses focus

onChange

The visitor alters a text field, text area, list, or menu

onClick

The visitor single-clicks with the left mouse button

onDblClick

The visitor double-clicks with the left mouse button

onDragDrop

The visitor drags an item and drops it on the browser window

onError

An image does not download correctly, usually because the path to the image is incorrect

onFocus

The element gains focus

onKeyDown

The visitor holds down a key

onKeyPress

The visitor presses a key

onKeyUp

The visitor releases a pressed key

onLoad

The browser loads the current web page

onMouseDown

The visitor holds down the left mouse button

onMouseMove

The visitor moves the mouse

onMouseOut

The visitor moves the mouse pointer away from the element

onMouseOver

The visitor hovers over the element with the mouse pointer

onMouseUp

The visitor releases the left mouse button after holding it down

onMove

The visitor moves a window or frame

onReset

The visitor resets a form

onResize

The visitor resizes the browser window

onSelect

The visitor selects text in a text field or text area

onSubmit

The visitor submits a form

onUnload

The browser begins to load a new web page




Dreamweaver 8 Design and Construction
Dreamweaver 8 Design and Construction (OReilly Digital Studio)
ISBN: 0596101635
EAN: 2147483647
Year: N/A
Pages: 154
Authors: Marc Campbell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net