Class sEvent
Defined in: <./sEvent.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
sEvent(eventObj)
Emulates the event object.
|
| Field Attributes | Field Name and Description |
|---|---|
|
A boolean indicating whether the event bubbles up through the DOM or not.
|
|
|
A boolean indicating whether the event is cancelable.
|
|
|
A reference to the currently registered target for the event.
|
|
|
Indicates whether or not
event.preventDefault() has been
called on the event. |
|
|
Indicates which phase of the event flow is being processed.
|
|
|
Indicates whether or not the event was initiated by the browser.
|
|
|
The native browser event object.
|
|
|
A reference to the target to which the event was originally dispatched.
|
|
|
The time that the event was created.
|
|
|
The name of the event.
|
| Method Attributes | Method Name and Description |
|---|---|
|
initEvent(type, bubbles, cancelable)
Initialise an event.
|
|
|
Cancels the event (if it is cancelable).
|
|
|
Prevents other listeners of the same event to be called.
|
|
|
Prevents further propagation of the current event.
|
Class Detail
sEvent(eventObj)
Emulates the event object.
- Parameters:
- {Event|Object} eventObj
- Native browser event or object that is similar (this includes IE's window.event).
- Returns:
- {sEvent} The event object.
- See:
- https://developer.mozilla.org/en/DOM/DOM_event_reference
Field Detail
{boolean}
bubbles
A boolean indicating whether the event bubbles up through the DOM or not.
{boolean}
cancelable
A boolean indicating whether the event is cancelable.
{Element|window|document}
currentTarget
A reference to the currently registered target for the event.
{boolean}
defaultPrevented
Indicates whether or not
event.preventDefault() has been
called on the event.
{number}
eventPhase
Indicates which phase of the event flow is being processed.
- See:
- https://developer.mozilla.org/en/DOM/event.eventPhase
{boolean}
isTrusted
Indicates whether or not the event was initiated by the browser.
{(Event|Object)}
originalEvent
The native browser event object.
{Element|window|document}
target
A reference to the target to which the event was originally dispatched.
{number}
timeStamp
The time that the event was created.
{string}
type
The name of the event.
Method Detail
initEvent(type, bubbles, cancelable)
Initialise an event. Does nothing in IE versions prior to 9.
- Parameters:
- {string} type
- Type of event.
- {boolean} bubbles
- A boolean indicating whether the event bubbles up through the DOM or not.
- {boolean} cancelable
- A boolean indicating whether the event can be canceled.
preventDefault()
Cancels the event (if it is cancelable).
stopImmediatePropagation()
Prevents other listeners of the same event to be called. Note that in IE
prior to version 9, this does the same thing as stopPropagation().
stopPropagation()
Prevents further propagation of the current event. Note that in IE prior to
version 9, this does the same thing as stopImmediatePropagation().