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
Copy file name to clipboardExpand all lines: 2-ui/1-document/11-coordinates/article.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,22 +21,22 @@ Quando il documento scorre:
21
21
22
22
## Le coordinate di un elemento: getBoundingClientRect
23
23
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).
25
25
26
-
Main `DOMRect` properties:
26
+
Ecco le principali proprietà di `DOMRect`:
27
27
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).
30
30
31
-
Additionally, there are derived properties:
31
+
Ci sono, inoltre, proprietà derivate:
32
32
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.
35
35
36
36
```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:
38
38
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>
40
40
41
41
<script>
42
42
function showRect(elem) {
@@ -53,7 +53,7 @@ right:${r.right}
53
53
}
54
54
</script>
55
55
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)
57
57
```
58
58
59
59
Here's the picture of `elem.getBoundingClientRect()` output:
0 commit comments