diff --git a/2-ui/2-events/02-bubbling-and-capturing/article.md b/2-ui/2-events/02-bubbling-and-capturing/article.md index 2448cfa5b..a624c07a2 100644 --- a/2-ui/2-events/02-bubbling-and-capturing/article.md +++ b/2-ui/2-events/02-bubbling-and-capturing/article.md @@ -1,24 +1,24 @@ -# Bubbling and capturing +# Bubbling e captura -Let's start with an example. +Vamos começar com um exemplo. -This handler is assigned to `
`, but also runs if you click any nested tag like `` or ``: +Este manipulador é atribuído ao `
`, mas também é executado se você clicar em qualquer tag aninhada, como `` ou ``: ```html autorun height=60 -
- If you click on EM, the handler on DIV runs. +
+ Se você clicar em EM, o manipulador em DIV é executado.
``` -Isn't it a bit strange? Why does the handler on `
` run if the actual click was on ``? +Não é um pouco estranho? Por que o manipulador em `
` é executado se o clique real foi em ``? ## Bubbling -The bubbling principle is simple. +O princípio do bubbling é simples. -**When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors.** +**Quando um evento acontece em um elemento, ele primeiro executa os manipuladores nele, depois no seu pai, e assim por diante, subindo por todos os outros ancestrais.** -Let's say we have 3 nested elements `FORM > DIV > P` with a handler on each of them: +Digamos que temos 3 elementos aninhados `FORM > DIV > P` com um manipulador em cada um deles: ```html run autorun