public interface DOMEvent
Modifier and Type | Method and Description |
---|---|
DOMEventTarget |
getCurrentTarget()
Returns the
返回当前正在处理其DOMEventListener的DOMEventTarget。 DOMEventTarget whose
DOMEventListeners are currently being processed.
|
DOMEventPhase |
getEventPhase()
Used to indicate which phase of event flow is currently being evaluated.
用于指示当前正在评估事件流的哪个阶段。 |
DOMEventTarget |
getTarget()
Returns the
返回事件最初分配到的DOMEventTarget。 DOMEventTarget to which the event was originally dispatched.
|
DOMEventType |
getType()
Returns the type of this DOM event.
返回此DOM事件的类型。 |
boolean |
isBubbles()
Used to indicate whether or not an event is a bubbling event.
用于指示事件是否为冒泡事件。 |
boolean |
isCancelable()
Used to indicate whether or not an event can have its default action prevented.
用于指示事件是否可以阻止其默认操作。 |
boolean |
isKeyboardEvent()
Indicates whether the event is a
指示事件是否为DOMKeyEvent,可以将其强制转换为此类型以获得有关键事件的更多信息。 DOMKeyEvent and it can be cast to this type to get more information about key event.
|
boolean |
isMouseEvent()
Indicates whether the event is a
指示事件是否为DOMMouseEvent,可以将其强制转换为此类型以获得有关鼠标事件的更多信息。 DOMMouseEvent and it can be cast to this type to get more information about mouse event.
|
boolean |
isUIEvent()
Indicates whether the event is a
指示事件是否为DOMUIEvent,可以将其强制转换为此类型以获取有关鼠标事件的更多信息。 DOMUIEvent and it can be cast to this type to get more information about mouse event.
|
void |
preventDefault()
Cancels the event if it is cancelable, without stopping further propagation of the event.
如果可以取消事件,则将其取消,而不停止事件的进一步传播。 |
void |
stopPropagation()
Prevents further propagation of the current event.
防止当前事件进一步传播。 |
DOMEventType getType()
DOMEventTarget getTarget()
DOMEventTarget
to which the event was originally dispatched.
DOMEventTarget getCurrentTarget()
DOMEventTarget
whose
DOMEventListeners
are currently being processed.
DOMEventPhase getEventPhase()
boolean isUIEvent()
DOMUIEvent
and it can be cast to this type to get more information about mouse event.
true
if the event is a
DOMUIEvent
.
如果事件是。
boolean isMouseEvent()
DOMMouseEvent
and it can be cast to this type to get more information about mouse event.
true
if the event is a
DOMMouseEvent
.
如果事件是。
boolean isKeyboardEvent()
DOMKeyEvent
and it can be cast to this type to get more information about key event.
true
if the event is a
DOMKeyEvent
.
如果事件是。
boolean isBubbles()
true
, else the value is
false
.
boolean isCancelable()
true
, else the value is
false
.
void preventDefault()
void stopPropagation()