When multiple observers are present, use the bubbling phase if you want closer observers to fire first.
当存在多个观测者时,如果希望首先触发最近的观测者则使用冒泡阶段。
If you need to set up an event observer, should you use the capture or bubbling phase? Here are a few guidelines.
如果需要设置事件观测者,应该使用捕获阶段还是冒泡阶段呢?
If the event reaches the target element without being handled and the event type allows it, the bubbling phase begins.
如果事件抵达目标元素而没有被处理并且该事件类型允许,则进入冒泡阶段。
The event travels upwards again and checks if any ancestor element of the target has an event handler for the bubbling phase.
这样就会阻止冒泡阶段事件的继续传播。 阻止捕获阶段的事件传播是不可能的。 有人也许会问为什么。
Keep in mind that the HTML 4.0-style attribute syntax, used for onunload in Listing 1, registers observers for the bubbling phase.
要记住,对于清单1中onunload所用的HTML 4.0风格的语法,观测者被注册到冒泡阶段。
The trip down to the target is known as the capture phase, while the trip back up again is known as the bubbling phase. (Not all events can bubble.)
向下行进到目标称为捕捉(capture)阶段,而再次向上行进称为冒泡(bubbling)阶段(并不是所有的事件都会冒泡)。
Some events like focus do not participate in the bubbling phase, and thus can only be observed during the capture phase or directly at the target.
某些事件(如 focus)不参与冒泡阶段,因此只能在捕获阶段观测,或者直接在目标上观测。
If you're dealing with only a single observation point, which is usually the case, you can use either the capture or bubbling phase — there's no real difference.
如果处理单个观测点——这也是最常见的情况,使用哪个阶段都行,两者没有实际区别。
By analyzing energy profile of different scale signals, we found that pressure fluctuations mainly reflect mesoscale interaction between the emulsion phase and the bubbling phase.
各尺度信号的能量分布表明,压力波动信号主要体现了介尺度的乳化相和气泡相之间的相互作用。
Whether the bubbling or capture phase is used, the default action always happens after all event propagation is finished.
无论使用冒泡阶段还是捕获阶段,默认动作总是在所有的传播完成后执行。
The capturing phase is very rarely used, and it can also be computationally intensive. By contrast, bubbling is much more common.
捕获阶段是很少用到的,它也可以是计算密集型。相比之下,冒泡更常见。
I want to prevent events from trickling down to the children and bubbling up again when a condition is met for the parent during the capturing phase.
我想防止事件扩散到儿童和鼓泡起来当条件满足的父母在捕获阶段。
I want to prevent events from trickling down to the children and bubbling up again when a condition is met for the parent during the capturing phase.
我想防止事件扩散到儿童和鼓泡起来当条件满足的父母在捕获阶段。
应用推荐