Object
zEvent
The zEvent
class is based on the DOM
Event
interface and is used to provide contextual information about an event to the handler
processing the event. A subclass of zEvent
is generally passed as the first parameter to an
event handler. More specific context information is passed to event handlers by deriving additional
subclasses from zEvent
which contain information directly relating to the type of event
they accompany.
Nicholas C. Zakas, http://www.nczonline.net/
1.0
1.0
boolean |
cancelable Indicates whether or not the event's default action can be cancelled. |
zEventTarget |
target The object that fired the event. |
long |
timeStamp The time that the event occurred in milliseconds since midnight, January 1, 1970. |
String |
type The type of event that was fired (i.e., "click"). |
zEvent() Creates a new instance of zEvent . |
void |
initEvent(String type, boolean cancelable) Initializes the event's type and cancelable fields to
the specified values. |
void |
preventDefault() Prevents the default action for an event (only if the event is cancelable). |
public boolean cancelable
Indicates whether or not the event's default action can be cancelled.
public zEventTarget target
The object that fired the event.
public long timeStamp
The time that the event occurred in milliseconds since midnight, January 1, 1970.
public String type
The type of event that was fired (i.e., "click").
public zEvent()
Creates a new instance of zEvent
.
public void initEvent(String type, boolean cancelable)
Initializes the event's type
and cancelable
fields to
the specified values.
type
- the type of event that has occurred.cancelable
- whether or not the default action of the event can be cancelled.public void preventDefault()
Prevents the default action of an event if the event is cancelable.