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.Envuelve cada nodo de título del árbol dentro de `<span>`. Luego podemos aplicarles CSS-style en `:hover`y manejar los clics exactamente sobre el texto, porque el ancho de `<span>`es exactamente el ancho del texto (no lo será si no lo tiene).
4
+
2.Establece el manejador al nodo raíz del `tree`y maneja los clics en aquellos títulos`<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
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
+
# Tabla ordenable
6
6
7
-
Make the table sortable: clicks on `<th>`elements should sort it by corresponding column.
7
+
Haz que la tabla se pueda ordenar: los clics en elementos `<th>`deberían ordenarla por la columna correspondiente.
8
8
9
-
Each`<th>`has the type in the attribute, like this:
9
+
Cada`<th>`tiene su tipo de datos en el atributo, como esto:
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
+
En el ejemplo anterior la primera columna tiene números y la segunda cadenas. La función de ordenamiento debe manejar el orden de acuerdo al tipo de dato.
36
36
37
-
Only `"string"`and`"number"`types should be supported.
37
+
Solamente los tipos `"string"`y`"number"`deben ser soportados.
38
38
39
-
The working example:
39
+
Ejemplo en funcionamiento:
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.D. La tabla puede ser grande, con cualquier cantidad de filas y columnas.
Copy file name to clipboardExpand all lines: 2-ui/2-events/03-event-delegation/4-behavior-tooltip/task.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,37 +2,37 @@ importance: 5
2
2
3
3
---
4
4
5
-
# Tooltip behavior
5
+
# Comportamiento: Tooltip
6
6
7
-
Create JS-code for the tooltip behavior.
7
+
Crea código JS para el comportamiento "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
+
Cuando un mouse pasa sobre un elemento con`data-tooltip`, el tooltip debe aparecer sobre él, y ocultarse cuando se va.
10
10
11
-
An example of annotated HTML:
11
+
Un ejemplo en HTML comentado:
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>
15
15
```
16
16
17
-
Should work like this:
17
+
Debe funcionar así:
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
+
En esta tarea suponemos que todos los elementos con`data-tooltip`solo tienen texto dentro. Sin tags anidados (todavía).
22
22
23
-
Details:
23
+
Detalles:
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 distancia entre el elemento y el tooltip debe ser`5px`.
26
+
-El tooltip debe ser centrado relativo al elemento si es posible.
27
+
-El tooltip no debe cruzar los bordes de la ventana. Normalmente debería estar sobre el elemento, pero si el elemento está en la parte superior de la página y no hay espacio para el tooltip, entonces debajo de él.
28
+
-El contenido del tooltip está dado en el atributo`data-tooltip`. Este puede ser HTML arbitrario.
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
+
Necesitarás dos eventos aquí:
31
+
-`mouseover`se dispara cuando el puntero pasa sobre el elemento.
32
+
-`mouseout`se dispara cuando el puntero deja el 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
+
Usa delegación de eventos: prepare dos manejadores en el `document`para rastrear todos los "overs" y "outs" de los elementos con `data-tooltip`y administra los tooltips desde allí.
35
35
36
-
After the behavior is implemented, even people unfamiliar with JavaScript can add annotated elements.
36
+
Después de implementar el comportamiento, incluso gente no familiarizada con JavaScript puede agregar elementos anotados.
37
37
38
-
P.S. Only one tooltip may show up at a time.
38
+
P.D. Solamente un tooltip puede mostrarse a la vez.
0 commit comments