You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.Wrap every tree node title into `<span>`. Then we can CSS-style them on `:hover` and handle clicks exactly on text, because `<span>`width is exactly the text width (unlike without it).
4
-
2.Set a handler to the `tree` root node and handle clicks on that`<span>` titles.
3
+
1.Inglobare il nodo che rappresenta il titolo dentro uno `<span>` e su questo elemento modificare gli i CSS per l'`:hover`; la gestione dei click con lo `<span>`è agevole perché questo occupa esattamente la larghezza del testo.
4
+
2.Impostare un gestore sul nodo radice dell'`albero` e gestire i click su questi titoli`<span>`.
Copy file name to clipboardExpand all lines: 2-ui/2-events/03-event-delegation/3-sortable-table/task.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@ importance: 4
2
2
3
3
---
4
4
5
-
# Sortable table
5
+
# Tabella ordinabile
6
6
7
-
Make the table sortable: clicks on `<th>`elements should sort it by corresponding column.
7
+
Rendere la tabella ordinabile: i click sui `<th>`dovrebbero ordinarne i valori secondo la colonna corrispondente.
8
8
9
-
Each`<th>`has the type in the attribute, like this:
9
+
Ogni`<th>`ha il suo tipo specificato nell'attributo, come in questo esempio:
10
10
11
11
```html
12
12
<tableid="grid">
@@ -32,12 +32,12 @@ Each `<th>` has the type in the attribute, like this:
32
32
</table>
33
33
```
34
34
35
-
In the example above the first column has numbers, and the second one -- strings. The sorting function should handle sort according to the type.
35
+
Nell'esempio, la prima colonna contiene numeri, la seconda -- stringhe. La funzione di ordinamento dovrebbe gestire l'ordine secondo il tipo specificato in attributo.
36
36
37
-
Only `"string"`and`"number"` types should be supported.
37
+
Devono essere supportati solo i tipi `"string"`e`"number"`.
38
38
39
-
The working example:
39
+
Esempio funzionante:
40
40
41
41
[iframe border=1 src="solution" height=190]
42
42
43
-
P.S. The table can be big, with any number of rows and columns.
43
+
P.S.: La tabella potrebbe essere grande, con una quantità arbitraria di righe e colonne.
Copy file name to clipboardExpand all lines: 2-ui/2-events/03-event-delegation/4-behavior-tooltip/task.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@ importance: 5
2
2
3
3
---
4
4
5
-
# Tooltip behavior
5
+
# Comportamento tooltip
6
6
7
-
Create JS-code for the tooltip behavior.
7
+
Creare uno script JS per un tooltip.
8
8
9
-
When a mouse comes over an element with `data-tooltip`, the tooltip should appear over it, and when it's gone then hide.
9
+
Quando il mouse passa sopra un elemento HTML con `data-tooltip`, dovrebbe comparire su di esso un tooltip, e scomparire dopo che ha abbandonato la usa area.
10
10
11
-
An example of annotated HTML:
11
+
Un esempio di HTML con tooltip:
12
12
```html
13
13
<buttondata-tooltip="the tooltip is longer than the element">Short button</button>
14
14
<buttondata-tooltip="HTML<br>tooltip">One more button</button>
@@ -18,21 +18,21 @@ Should work like this:
18
18
19
19
[iframe src="solution" height=200 border=1]
20
20
21
-
In this task we assume that all elements with `data-tooltip`have only text inside. No nested tags (yet).
21
+
In questo compito assumiamo che tutti gli elementi con il `data-tooltip`contengano solamente testo. Nessun tag annidato.
22
22
23
-
Details:
23
+
Dettagli:
24
24
25
-
-The distance between the element and the tooltip should be`5px`.
26
-
-The tooltip should be centered relative to the element, if possible.
27
-
-The tooltip should not cross window edges. Normally it should be above the element, but if the element is at the page top and there's no space for the tooltip, then below it.
28
-
-The tooltip content is given in the`data-tooltip` attribute. It can be arbitrary HTML.
25
+
-La distanza tra l'elemento e la sua tooltip dovrebbe essere di`5px`.
26
+
-Il tooltip, possibilmente, dovrebbe essere centrato rispetto all'elemento.
27
+
-Il tooltip non dovrebbe oltrepassare i bordi della finestra. Normalmente dovrebbe stare sopra l'elemento, ma se quest'ultimo dovesse essere nella parte superiore della finestra, allora dovrebbe stare sotto.
28
+
-Il contenuto del tooltip è dato dall'attributo`data-tooltip`. Può essere un qualunque HTML.
29
29
30
-
You'll need two events here:
31
-
-`mouseover`triggers when a pointer comes over an element.
32
-
-`mouseout`triggers when a pointer leaves an element.
30
+
Sono necessari due eventi:
31
+
-`mouseover`viene innescato quando il puntatore passa sopra l'elemento.
32
+
-`mouseout`innescato quando il puntatore abbandona un elemento.
33
33
34
-
Please use event delegation: set up two handlers on `document`to track all "overs" and "outs" from elements with`data-tooltip`and manage tooltips from there.
34
+
Usare la event delegation: impostare due gestori su `document`per tenere traccia di tutti gli "overs" ed "outs" degli elementi con`data-tooltip`e gestirli da lì.
35
35
36
-
After the behavior is implemented, even people unfamiliar with JavaScript can add annotated elements.
36
+
Dopo che il comportamento è stato implementato, anche persone non avvezze a JavaScript possono aggiungere elementi con i tooltip.
37
37
38
-
P.S. Only one tooltip may show up at a time.
38
+
P.S.: Può essere mostrato solo un tooltip alla volta.
0 commit comments