Merge pull request #2218 from aruku/aruku-patch-1
One addition and one fix
This commit is contained in:
commit
a10d94d983
2 changed files with 2 additions and 2 deletions
|
@ -206,7 +206,7 @@ When an event happens -- the most nested element where it happens gets labeled a
|
||||||
|
|
||||||
- Then the event moves down from the document root to `event.target`, calling handlers assigned with `addEventListener(..., true)` on the way (`true` is a shorthand for `{capture: true}`).
|
- Then the event moves down from the document root to `event.target`, calling handlers assigned with `addEventListener(..., true)` on the way (`true` is a shorthand for `{capture: true}`).
|
||||||
- Then handlers are called on the target element itself.
|
- Then handlers are called on the target element itself.
|
||||||
- Then the event bubbles up from `event.target` to the root, calling handlers assigned using `on<event>` and `addEventListener` without the 3rd argument or with the 3rd argument `false/{capture:false}`.
|
- Then the event bubbles up from `event.target` to the root, calling handlers assigned using `on<event>`, HTML attributes and `addEventListener` without the 3rd argument or with the 3rd argument `false/{capture:false}`.
|
||||||
|
|
||||||
Each handler can access `event` object properties:
|
Each handler can access `event` object properties:
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ Capturing and bubbling allow us to implement one of most powerful event handling
|
||||||
|
|
||||||
The idea is that if we have a lot of elements handled in a similar way, then instead of assigning a handler to each of them -- we put a single handler on their common ancestor.
|
The idea is that if we have a lot of elements handled in a similar way, then instead of assigning a handler to each of them -- we put a single handler on their common ancestor.
|
||||||
|
|
||||||
In the handler we get `event.target`, see where the event actually happened and handle it.
|
In the handler we get `event.target` to see where the event actually happened and handle it.
|
||||||
|
|
||||||
Let's see an example -- the [Ba-Gua diagram](http://en.wikipedia.org/wiki/Ba_gua) reflecting the ancient Chinese philosophy.
|
Let's see an example -- the [Ba-Gua diagram](http://en.wikipedia.org/wiki/Ba_gua) reflecting the ancient Chinese philosophy.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue