From a346e9abf9ca0bfe18aca531c4c8155b0ee591c9 Mon Sep 17 00:00:00 2001 From: pierangelomiceli Date: Sat, 30 Jan 2021 13:47:10 +0100 Subject: [PATCH 01/15] traduzione bubbling e capturing --- .../02-bubbling-and-capturing/article.md | 174 +++++++++--------- 1 file changed, 87 insertions(+), 87 deletions(-) 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 5d854a59f..55fb2cb7e 100644 --- a/2-ui/2-events/02-bubbling-and-capturing/article.md +++ b/2-ui/2-events/02-bubbling-and-capturing/article.md @@ -1,8 +1,8 @@ -# Bubbling and capturing +# Bubbling e capturing -Let's start with an example. +Cominciamo con un esempio. -This handler is assigned to `
`, but also runs if you click any nested tag like `` or ``: +Questo gestore è assegnato al `
`, ma viene eseguito anche se clicchiamo qualunque tag come ad esempio `` oppure ``: ```html autorun height=60
@@ -10,15 +10,15 @@ This handler is assigned to `
`, but also runs if you click any nested tag l
``` -Isn't it a bit strange? Why does the handler on `
` run if the actual click was on ``? +Non è un po' strano? Perché il gestore su `
` viene eseguito se il click è su``? ## Bubbling -The bubbling principle is simple. +Il principio alla base del *bubbling* è semplice. -**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 viene innescato un evento su un elemento, come prima cosa vengono eseguito i gestori ad esso assegnati, poi ai nodi genitori, ed infine risale fino agli altri nodi antenati.** -Let's say we have 3 nested elements `FORM > DIV > P` with a handler on each of them: +Poniamo il caso di avere 3 elementi annidati `FORM > DIV > P` con un gestore per ognuno di essi: ```html run autorun