@@ -104,15 +104,15 @@ Se diamo una semplice occhiata all'immagine sopra, possiamo notare che in JavaSc
104104
105105## elementFromPoint(x, y) [ #elementFromPoint]
106106
107- The call to ` document.elementFromPoint(x, y) ` returns the most nested element at window coordinates ` (x, y) ` .
107+ La chiamata a ` document.elementFromPoint(x, y) ` restituisce l'elemento più annidato alle coordinate ` (x, y) ` relative alla finestra .
108108
109- The syntax is :
109+ La sintassi è :
110110
111111``` js
112112let elem = document .elementFromPoint (x, y);
113113```
114114
115- For instance, the code below highlights and outputs the tag of the element that is now in the middle of the window :
115+ Il codice sotto, ad esempio, evidenzia e mostra il tag dell'elemento che si trova adesso al centro della finestra :
116116
117117``` js run
118118let centerX = document .documentElement .clientWidth / 2 ;
@@ -124,25 +124,25 @@ elem.style.background = "red";
124124alert (elem .tagName );
125125```
126126
127- As it uses window coordinates, the element may be different depending on the current scroll position .
127+ Dal momento che usa le coordinate relative alla finestra, l'elemento può variare in base alla posizione di scorrimento corrente .
128128
129- ````warn header="For out-of-window coordinates the ` elementFromPoint ` returns ` null ` "
130- The method ` document.elementFromPoint(x,y) ` only works if ` (x,y) ` are inside the visible area.
129+ ````warn header="Per coordinate al di fuori della finestra ` elementFromPoint ` restituisce ` null ` "
130+ Il metodo ` document.elementFromPoint(x,y) ` funziona solo se ` (x,y) ` sono dentro l' area visibile .
131131
132- If any of the coordinates is negative or exceeds the window width/height, then it returns ` null ` .
132+ Se una delle coordinate è negativa o eccede le dimensioni della finestra, restituisce ` null ` .
133133
134- Here's a typical error that may occur if we don't check for it :
134+ Ecco un tipico errore che può verificarsi se non prestiamo attenzione a questa eventualità :
135135
136136``` js
137137let elem = document .elementFromPoint (x, y);
138- // if the coordinates happen to be out of the window, then elem = null
138+ // se le coordinate sono fuori dalla finestra elem = null
139139* ! *
140140elem .style .background = ' ' ; // Error!
141141*/ ! *
142142```
143143````
144144
145- ## Using for "fixed" positioning
145+ ## Uso per il posizionamento "fisso"
146146
147147Most of time we need coordinates in order to position something.
148148
0 commit comments