Skip to content

Commit 62fba3d

Browse files
committed
Update 2-ui\1-document\11-coordinates\tasks
1 parent 1145ea8 commit 62fba3d

File tree

9 files changed

+39
-39
lines changed

9 files changed

+39
-39
lines changed

2-ui/1-document/11-coordinates/1-find-point-coordinates/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Nell'iframe sotto potete osservare un documento con un "campo" verde.
88

99
Usate JavaScript per trovare le coordinate relative alla finestra degli angoli indicati dalle frecce.
1010

11-
Per comodità è stata implementata una semplice funzionalità nel documento: un click in un punto qualsiasi ne mostra le coordinate.
11+
Per comodità è stata implementata una semplice funzionalità nel documento: un click in un punto qualsiasi mostra le coordinate.
1212

1313
[iframe border=1 height=360 src="source" link edit]
1414

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this task we only need to accurately calculate the coordinates. See the code for details.
1+
In questo esercizio dobbiamo solo calcolare accuratamente le coordinate. Guardate il codice per i dettagli.
22

3-
Please note: the elements must be in the document to read `offsetHeight` and other properties.
4-
A hidden (`display:none`) or out of the document element has no size.
3+
Nota bene: gli elementi devono essere visibili nel documento per leggere `offsetHeight` e le altre proprietà.
4+
Un elemento nascosto (`display:none`) o fuori dal documento non ha dimensioni.

2-ui/1-document/11-coordinates/2-position-at/solution.view/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
<script>
2626
/**
27-
* Positions elem relative to anchor as said in position.
27+
* Posiziona elem relativamente a anchor come indicato in position.
2828
*
29-
* @param {Node} anchor Anchor element for positioning
30-
* @param {string} position One of: top/right/bottom
31-
* @param {Node} elem Element to position
29+
* @param {Node} anchor Elemento di riferimento per il posizionamento
30+
* @param {string} position Un valore tra: top/right/bottom
31+
* @param {Node} elem Elemento da posizionare
3232
*
33-
* Both elements: elem and anchor must be in the document
33+
* Entrambi gli elementi, elem e anchor, devono essere visibili nel documento
3434
*/
3535
function positionAt(anchor, position, elem) {
3636

@@ -55,10 +55,10 @@
5555

5656
}
5757

58-
/**
59-
* Shows a note with the given html at the given position
60-
* relative to the anchor element.
61-
*/
58+
/**
59+
* Mostra una nota con l'html passato come parametro nella posizione indicata
60+
* relativa all'elemento anchor.
61+
*/
6262
function showNote(anchor, position, html) {
6363

6464
let note = document.createElement('div');
@@ -69,7 +69,7 @@
6969
positionAt(anchor, position, note);
7070
}
7171

72-
// test it
72+
// prova
7373
let blockquote = document.querySelector('blockquote');
7474

7575
showNote(blockquote, "top", "note above");

2-ui/1-document/11-coordinates/2-position-at/source.view/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424

2525
<script>
2626
/**
27-
* Positions elem relative to anchor as said in position.
27+
* Posiziona elem relativamente a anchor come indicato in position.
2828
*
29-
* @param {Node} anchor Anchor element for positioning
30-
* @param {string} position One of: top/right/bottom
31-
* @param {Node} elem Element to position
29+
* @param {Node} anchor Elemento di riferimento per il posizionamento
30+
* @param {string} position Un valore tra: top/right/bottom
31+
* @param {Node} elem Elemento da posizionare
3232
*
33-
* Both elements: elem and anchor must be in the document
33+
* Entrambi gli elementi, elem e anchor, devono essere visibili nel documento
3434
*/
3535
function positionAt(anchor, position, elem) {
3636
// ... your code ...
3737
}
3838

3939
/**
40-
* Shows a note with the given html at the given position
41-
* relative to the anchor element.
40+
* Mostra una nota con l'html passato come parametro nella posizione indicata
41+
* relativa all'elemento anchor.
4242
*/
4343
function showNote(anchor, position, html) {
4444

@@ -50,7 +50,7 @@
5050
positionAt(anchor, position, note);
5151
}
5252

53-
// test it
53+
// prova
5454
let blockquote = document.querySelector('blockquote');
5555

5656
showNote(blockquote, "top", "note above");

2-ui/1-document/11-coordinates/2-position-at/task.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ importance: 5
22

33
---
44

5-
# Show a note near the element
5+
# Mostrate una nota vicino l'elemento
66

7-
Create a function `positionAt(anchor, position, elem)` that positions `elem`, depending on `position` near `anchor` element.
7+
Create una funzione `positionAt(anchor, position, elem)` che posizioni `elem` vicino l'elemento `anchor` in base a `position`.
88

9-
The `position` must be a string with any one of 3 values:
10-
- `"top"` - position `elem` right above `anchor`
11-
- `"right"` - position `elem` immediately at the right of `anchor`
12-
- `"bottom"` - position `elem` right below `anchor`
9+
Il parametro `position` deve essere una stringa con uno dei 3 valori seguenti:
10+
- `"top"` - posiziona `elem` proprio sopra `anchor`
11+
- `"right"` - posiziona `elem` subito a destra di `anchor`
12+
- `"bottom"` - posiziona `elem` esattamente sotto `anchor`
1313

14-
It's used inside function `showNote(anchor, position, html)`, provided in the task source code, that creates a "note" element with given `html` and shows it at the given `position` near the `anchor`.
14+
Il codice che scriverete viene richiamato dalla funzione `showNote(anchor, position, html)`, che trovate nel codice sorgente dell'esercizio e che crea una nota con l'`html` passato come parametro e lo mostra nella `position` assegnata vicino all'elemento `anchor`.
1515

16-
Here's the demo of notes:
16+
Ecco un esempio:
1717

1818
[iframe src="solution" height="350" border="1" link]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The solution is actually pretty simple:
1+
La soluzione è in realtà piuttosto semplice:
22

3-
- Use `position:absolute` in CSS instead of `position:fixed` for `.note`.
4-
- Use the function [getCoords()](info:coordinates#getCoords) from the chapter <info:coordinates> to get document-relative coordinates.
3+
- Utilizzate `position:absolute` nel file CSS invece di `position:fixed` per `.note`.
4+
- Utilizzate la funzione [getCoords()](info:coordinates#getCoords) della sezione <info:coordinates> per ottenere le coordinate relative al documento.

2-ui/1-document/11-coordinates/3-position-at-absolute/solution.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
positionAt(anchor, position, note);
6767
}
6868

69-
// test it
69+
// prova
7070
let blockquote = document.querySelector('blockquote');
7171

7272
showNote(blockquote, "top", "note above");

2-ui/1-document/11-coordinates/3-position-at-absolute/task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ importance: 5
22

33
---
44

5-
# Show a note near the element (absolute)
5+
# Mostrate una nota vicino l'elemento (position:absolute)
66

7-
Modify the solution of the [previous task](info:task/position-at) so that the note uses `position:absolute` instead of `position:fixed`.
7+
Modificate la soluzione dell'[esercizio precedente](info:task/position-at) affinché la nota utilizzi `position:absolute` invece di `position:fixed`.
88

9-
That will prevent its "runaway" from the element when the page scrolls.
9+
In questo modo eviteremo che si allontani dall'elemento quando la pagina scorre.
1010

11-
Take the solution of that task as a starting point. To test the scroll, add the style `<body style="height: 2000px">`.
11+
Prendete la soluzione dell'esecizio precedente come punto di partenza. Per testare lo scorrimento aggiungete lo stile `<body style="height: 2000px">`.

2-ui/1-document/11-coordinates/4-position-inside-absolute/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ importance: 5
22

33
---
44

5-
# Position the note inside (absolute)
5+
# Position the note inside (position:absolute)
66

77
Extend the previous task <info:task/position-at-absolute>: teach the function `positionAt(anchor, position, elem)` to insert `elem` inside the `anchor`.
88

0 commit comments

Comments
 (0)