In JavaScript learning, we often encounter JavaScript event mechanisms, such as event binding, event monitoring, event delegation (event broker), and so on. What do these nouns mean, and what is the effect?
Event Bindings
To all
To understand the JS event mechanism, there are several concepts that must be understood: Event object, event source, and event flowEvent object:When an event occurs, an event object is generated, and the
I. Flow of eventsThe event flow describes the order in which events are accepted from the page.The event stream of IE is the event bubbling stream, and the Netscape event stream is the event capture stream1. Event bubblingEvent bu
The DOM Event standard defines two event streams, which are significantly different and may have a considerable impact on your application. The two event streams are capture and bubble. Like many Web technologies, before they become standards, Netscape and Microsoft implement them differently. The following describes the DOM
I. Overview of EVENTSEvent Overview-When a user interacts with a Web page, the interpreter creates an event object to describe the incident information. The common events are:-The user clicks on a content on the page-mouse over a specific element-The user presses a key on the keyboard-The user scrolls the window or changes the window size-page element loading completed or failed to load- ...-1995 IE4 Browser has defined its own
Let's look at the following sample code:HTMLxmlns= "http://www.w3.org/1999/xhtml">Head>title>Event bubbling and event capture in JavaScripttitle>Head>Body> DivID= "Red"style= "width:200px;height:200px;background-color:red;padding:20px;"> DivID= "Bule"style= "width:160px;height:160px;background-color:blue;padding:20px;"> DivID= "Yellow"style= "width:120px;height:120px;margin:auto;backgro
1. Event Flow When the browser developed to the 4th generation, the browser development team encountered a problem: which element of the page would have a particular event? When you click a button, it is obvious that the click event does not just occur on the button, it also occurs on all ancestor elements of the button, such as the container element of the butto
Anatomy of event distribution source code in QTEvent delivery sequence in QT:In a supposed program, it goes into an event loop, accepts the events generated by the system, and distributes them, all in exec.The following examples illustrate:1) First Look at the following example code:[CPP]View Plaincopy
int main (int argc, char *argv[])
{
Qapplication A (argc, argv);
MouseEvent W;
W
Understand JQuery's event binding feature and event namespace mechanism, and write better and more flexible event processing code.
Bind () and unbind () in JQuery provide the event binding and cancellation mechanisms, which can bind events supported by html by default and custom events. JQuery supports custom events, w
Understand JQuery's event binding feature and event namespace mechanism, and write better and more flexible event processing code
Bind () and unbind () in JQuery provide the event binding and cancellation mechanisms, which can bind events supported by html by default and custom events. JQuery supports custom events, wh
Related reading:
JavaScript Event Learning Summary (v) Event type mouse events in JS
Http://www.jb51.net/article/86259.htm
JavaScript Event Learning Summary (i) Event flow
Http://www.jb51.net/article/86261.htm
A summary of JavaScript event Learning (iv) Public members o
Event Flow:Event Bubbling: The event is initially received by the most specific element (the node with the deepest nesting level in the document) and then propagated up to the least specific node (document).Event capture: A less specific node should receive an event earlier, and the most specific node receives the
When the browser resolves the event, there are two types of triggers, one called bubbling (bubbling) and the other is called capturing (capture). The effect of bubbling is that when an event of a DOM element, such as the Click event, is triggered by F, the Click event of its parent element is fire (triggered) and passe
Event Flow: Describes the order in which events are received in a page event bubbling: Node (document) event captures that are received by the most specific element and then propagated up to the least specific element: the least specific node receives the event first, The most specific node should be the last receive
Related reading:
JavaScript Event Learning Summary (v) Event type mouse events in JS
Http://www.jb51.net/article/86259.htm
JavaScript Event Learning Summary (i) Event flow
Http://www.jb51.net/article/86261.htm
A summary of JavaScript event Learning (iv) Public members o
Click the differences between the event and the touch event, and click the event touch
For a View component on the screen, how does Android differentiate whether an onTouch event or an onClick event should be triggered? In Android, a user operation can be processed by differ
1.HTML Event handlersAn event supported by an element can be specified by an HTML attribute with the same name as the corresponding event handler. The value of this attribute should be the ability to execute the JS code. For example: button click is to execute some JS code, can resemble below:In JS can be processed as follows:The this point in the ShowMessage win
X: set or obtain the position of the outer boundary of the parent element of the mouse relative to the target event on the X coordinate.
Clientx: The X coordinate position of the client region, excluding the scroll bar, that is, the body area.
Offsetx: set or obtain the position of the inner boundary of the parent element of the mouse relative to the target event on the X coordinate.
Screenx: relative to th
Event bubbling: the deepest element of event promotion first receives events. Then, the parent element of the object goes up until the document Object finally receives the event. Although a document does not have an independent visual representation relative to an html element, it is still the parent element of an html element and events can bubble to the documen
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.