Binding Event Sequence in JS (difference between event bubbling and event capturing) and js bubbling
In JS, the default execution time of bound events is in the bubble stage, rather than in the capture stage (important). This is w
Event flow refers to the order in which events are received in the page, IE, Firefox, and Chrome browsers are event bubbling, which is called event bubbling, where events are first received by the most specific elements and then propagated up to the nodes that are not specif
-Event bubbling and capturing-Event Monitoring--Block event propagationOne, event bubbling and capturing1, concept : When the child element and the parent element defined the same
more compatible with these legacy issues. To be compatible, we have to understand the rationale, in addition to the dependency framework.
Dom Event three phases
When a DOM event is triggered, it is not simply triggered once on its own object, but it goes through three different stages:
1. Capture phase : First, the document root node documents to the event
Three phases of dom Event bubbling and dom Event capturing
This article mainly solves two problems:
Click Me
What is event stream
Three phases of DOM event streamCauseTo be honest, no matter what framework you are, you can't d
; --->
That is, during the event capture process, the document object receives the Click event First, and then the event goes down in the DOM tree and continues to propagate to the actual target of the event, the element. This is the event capture. And the
There are three stages in the DOM event flow: The event capture phase, the target stage, and the event bubbling phase. Event capture (dubbed bubbling): The popular understanding is that when a mouse clicks or triggers a DOM
both have an OnClick event handler function (event handler). If the user clicks Element 2, the click events for element 1 and element 2 are triggered. But which event is triggered first. Which event handler function will be executed first. In other words, the order in which events occur.
Two kinds of models
Predictabl
and ImpressionsEvent Flow: Describes the order in which events are accepted from the page. There are two types of event bubbling and event capture. Three phases of the DOM event stream:
event capture phase
in target phase
complain. The order you complain about this time is you > Mom > Dad. So you go back and see if the order is the same as the event bubble?You don't know that, I'm going to have to code."Utf-8"> "stylesheet"Type="Text/css"href="">"Click"> "Click2" class="son">1. What happens if I click Id=click2, which is the second one? He will trigger the Click2 event first, then go up, then trigger the Click
1 Event propagation--bubbling and capturingBy default, events use the bubbling event stream and do not use the capture event stream. However, in Firefox and Safari, you can explicitly specify the use of the capture event stream by
(i) Event-handling model---event bubbling, capturing(1) Event bubbling - - - - - in - to + - theAs follows: Click on the Blue area, three div will be corresponding Click event(2)
This article is from the "Empty" blog, make sure to keep this source http://6738767.blog.51cto.com/6728767/1583076JavaScript example six (event bubbling and capturing)
register multiple event listeners for the same event? Originally, the attachEvent () method was introduced to support this feature from the IE5.0 series. Unfortunately, this method does not support event capture. This method has been discarded since IE 11.
Event capture and bubbl
| | ------------------------- || | Element2 | | | ------------------------- || | -----------------------------------Element2 is a child element of element1, both of which define the onclick event.This is the problem that the event model (event sequence) will address .two types of modelsBack in the era of Netscape and Mic
Examples of capturing and bubbling in JavaScript, and javascript bubbling
Capture/block capture, bubble/block bubbling in JavaScript
The event stream describes the sequence of events received from the page. The concept of event st
The event flow describes the order in which events are received from the page. It is IE and Netscape that bring up the concept of the event flow, but the former is a common event bubbling stream, and the latter is the event capture stream.
The first part:
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.