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/10-size-and-scroll-window/article.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,24 @@ Come scoprire la larghezza e l'altezza della finestra del browser? Come ricavare
4
4
5
5
Per questo genere di informazioni possiamo utilizzare l'elemento radice del documento `document.documentElement`, che corrisponde al tag `<html>`. Ci sono, tuttavia, ulteriori metodi e peculiarità da considerare.
6
6
7
-
## Width/height of the window
7
+
## Larghezza e altezza della finestra
8
8
9
-
To get window width and height, we can use the `clientWidth/clientHeight`of`document.documentElement`:
9
+
Per ottenere la larghezza e l'altezza della finestra, possiamo far uso delle proprietà `clientWidth/clientHeight`di`document.documentElement`:
10
10
11
11

12
12
13
13
```online
14
-
For instance, this button shows the height of your window:
14
+
Ad esempio questo pulsante mostra l'altezza della tua finestra:
I browser supportano inoltre proprietà come `window.innerWidth/innerHeight`. Sembra che facciano al nostro caso, quindi perché non usare queste?
21
21
22
-
If there exists a scrollbar, and it occupies some space, `clientWidth/clientHeight`provide the width/height without it (subtract it). In other words, they return the width/height of the visible part of the document, available for the content.
22
+
Se esiste una barra di scorrimento ed occupa uno spazio, `clientWidth/clientHeight`forniscono la larghezza e l'altezza al netto della barra (la sottraggono). In altre parole restituiscono le dimensioni della parte visibile del documento disponibile per il contenuto.
23
23
24
-
`window.innerWidth/innerHeight`includes the scrollbar.
24
+
`window.innerWidth/innerHeight`includono la barra di scorrimento.
25
25
26
26
If there's a scrollbar, and it occupies some space, then these two lines show different values:
0 commit comments