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
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,22 +58,22 @@ alert("Altezza totale del documento, compresa la parte fuori dall'area visibile
58
58
59
59
Perché così? Meglio non chiedere. Queste incongruenze provengono da tempi lontani, non c'è alcuna logica.
60
60
61
-
## Ottenere il valore corrente dello scorrimento [#page-scroll]
61
+
## Ottenere il valore corrente di scorrimento [#page-scroll]
62
62
63
-
DOM elements have their current scroll state in their `scrollLeft/scrollTop` properties.
63
+
Gli elementi DOM memorizzano lo stato corrente dei valori di scorrimento nelle loro proprietà `scrollLeft/scrollTop`.
64
64
65
-
For document scroll, `document.documentElement.scrollLeft/scrollTop` works in most browsers, except older WebKit-based ones, like Safari (bug [5991](https://bugs.webkit.org/show_bug.cgi?id=5991)), where we should use `document.body` instead of `document.documentElement`.
65
+
Per lo scorrimento del documento, `document.documentElement.scrollLeft/scrollTop` funzionano sulla maggioranza dei browser, ad eccezione di quelli più vecchi basati su WebKit, come Safari (bug [5991](https://bugs.webkit.org/show_bug.cgi?id=5991)), dove dovremmo usare `document.body` al posto di `document.documentElement`.
66
66
67
-
Luckily, we don't have to remember these peculiarities at all, because the scroll is available in the special properties, `window.pageXOffset/pageYOffset`:
67
+
Fortunatamente, non dobbiamo ricordare affatto queste peculiarità, perché lo scorrimento del documento è disponibile anche nelle speciali proprietà `window.pageXOffset/pageYOffset`:
68
68
69
69
```js run
70
-
alert('Current scroll from the top: ' + window.pageYOffset);
71
-
alert('Current scroll from the left: ' + window.pageXOffset);
0 commit comments