Skip to content

Commit 02b01dd

Browse files
committed
Update 2-ui\1-document\11-coordinates\article.md
1 parent 15f9ecc commit 02b01dd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

2-ui/1-document/11-coordinates/article.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ Quando il documento scorre:
2121

2222
## Le coordinate di un elemento: getBoundingClientRect
2323

24-
The method `elem.getBoundingClientRect()` returns window coordinates for a minimal rectangle that encloses `elem` as an object of built-in [DOMRect](https://www.w3.org/TR/geometry-1/#domrect) class.
24+
Il metodo `elem.getBoundingClientRect()` restituisce le coordinate relative alla finestra del rettangolo minimo che racchiude `elem` come oggetto della classe nativa [DOMRect](https://www.w3.org/TR/geometry-1/#domrect).
2525

26-
Main `DOMRect` properties:
26+
Ecco le principali proprietà di `DOMRect`:
2727

28-
- `x/y` -- X/Y-coordinates of the rectangle origin relative to window,
29-
- `width/height` -- width/height of the rectangle (can be negative).
28+
- `x/y` -- le coordinate X/Y dell'origine rettangolo relative alla finestra,
29+
- `width/height` -- larghezza/altezza del rettangolo (può avere valori negativi).
3030

31-
Additionally, there are derived properties:
31+
Ci sono, inoltre, proprietà derivate:
3232

33-
- `top/bottom` -- Y-coordinate for the top/bottom rectangle edge,
34-
- `left/right` -- X-coordinate for the left/right rectangle edge.
33+
- `top/bottom` -- la coordinata Y per i bordi superiore/inferiore del rettangolo,
34+
- `left/right` -- la coordinata X per i bordi sinistro/destro del rettangolo.
3535

3636
```online
37-
For instance click this button to see its window coordinates:
37+
Clicca, per esempio, su questo pulsante per conoscere le sue coordinate relative alla finestra:
3838
39-
<p><input id="brTest" type="button" value="Get coordinates using button.getBoundingClientRect() for this button" onclick='showRect(this)'/></p>
39+
<p><input id="brTest" type="button" value="Ottieni le coordinate utilizzando button.getBoundingClientRect() per questo pulsante" onclick='showRect(this)'/></p>
4040
4141
<script>
4242
function showRect(elem) {
@@ -53,7 +53,7 @@ right:${r.right}
5353
}
5454
</script>
5555
56-
If you scroll the page and repeat, you'll notice that as window-relative button position changes, its window coordinates (`y/top/bottom` if you scroll vertically) change as well.
56+
Se scorrete la pagina e ripetete il test, noterete che quando cambia la posizione relativa alla finestra del pulsante, cambiano anche le sue coordinate relative alla finestra (`y/top/bottom` se scorri verticalmente)
5757
```
5858

5959
Here's the picture of `elem.getBoundingClientRect()` output:

0 commit comments

Comments
 (0)