Skip to content

Commit 65c5f95

Browse files
committed
Update 2-ui\1-document\09-size-and-scroll\tasks
1 parent 7413592 commit 65c5f95

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
To get the scrollbar width, we can create an element with the scroll, but without borders and paddings.
1+
Per ricavare la larghezza della barra di scorrimento, possiamo creare un elemento con scorrimento ma senza bordi e padding.
22

3-
Then the difference between its full width `offsetWidth` and the inner content area width `clientWidth` will be exactly the scrollbar:
3+
In quel caso la sottrazione tra la larghezza totale `offsetWidth` e la larghezza dell'area interna del contenuto `clientWidth` equivarrà esattamente alla larghezza della barra di scorrimento:
44

55
```js run
6-
// create a div with the scroll
6+
// creiamo un div con scorrimento
77
let div = document.createElement('div');
88

99
div.style.overflowY = 'scroll';
1010
div.style.width = '50px';
1111
div.style.height = '50px';
1212

13-
// must put it in the document, otherwise sizes will be 0
13+
// dobbiamo inserirlo nel flusso del documento, altrimenti le dimensioni saranno pari a 0
1414
document.body.append(div);
1515
let scrollWidth = div.offsetWidth - div.clientWidth;
1616

2-ui/1-document/09-size-and-scroll/2-scrollbar-width/task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ importance: 3
22

33
---
44

5-
# What is the scrollbar width?
5+
# Qual è la larghezza della barra di scorrimento?
66

7-
Write the code that returns the width of a standard scrollbar.
7+
Scrivete il codice che restituisca la larghezza di una barra di scorrimento standard.
88

9-
For Windows it usually varies between `12px` and `20px`. If the browser doesn't reserve any space for it (the scrollbar is half-translucent over the text, also happens), then it may be `0px`.
9+
Per Windows solitamente varia tra `12px` e `20px`. Se il browser non le riserva alcuno spazio (capita che la barra di scorrimento appaia semi-opaca sopra il testo), allora può essere `0px`.
1010

11-
P.S. The code should work for any HTML document, do not depend on its content.
11+
P.S. Il codice dovrebbe funzionare per ogni documento HTML indipendentemente dal contenuto.

0 commit comments

Comments
 (0)