[−][src]Trait stdweb::web::event::IEvent
The IEvent
interface represents any event which takes place in the DOM; some
are user-generated (such as mouse or keyboard events), while others are
generated by APIs (such as events that indicate an animation has finished
running, a video has been paused, and so forth). There are many types of event,
some of which use other interfaces based on the main IEvent
interface. IEvent
itself contains the properties and methods which are common to all events.
Provided methods
fn bubbles(&self) -> bool
Indicates whether this event bubbles upward through the DOM.
fn cancel_bubble(&self) -> bool
A historical alias to Event.stopPropagation()
.
fn set_cancel_bubble(&self, value: bool)
A historical alias to Event.stopPropagation()
.
Setting this to true
before returning from an event handler will stop propagation
of the event.
fn cancelable(&self) -> bool
Indicates whether the event is cancelable.
fn current_target(&self) -> Option<EventTarget>
A reference to the currently registered target of this event.
fn default_prevented(&self) -> bool
Indicates whether preventDefault
has been called on this event.
fn event_phase(&self) -> EventPhase
Indicates which phase of event flow is currently being evaluated.
fn stop_immediate_propagation(&self)
Prevents any further listeners from being called for this event.
fn stop_propagation(&self)
Stops the propagation of this event to descendants in the DOM.
fn target(&self) -> Option<EventTarget>
Returns a reference to the target to which this event was originally registered.
fn time_stamp(&self) -> Option<f64>
Returns the time in milliseconds at which this event was created.
fn is_trusted(&self) -> bool
Indicates whether the event was generated by a user action.
fn event_type(&self) -> String
Returns a string containing the type of event. It is set when the event is constructed and is the name commonly used to refer to the specific event.
fn prevent_default(&self)
Cancels the event if it is cancelable, without stopping further propagation of the event.