From 76205d7e8bc3729a401f6c374abe144b32e1854c Mon Sep 17 00:00:00 2001 From: 80001 <57833120+80001@users.noreply.github.com> Date: Fri, 21 Oct 2022 18:53:01 +0300 Subject: [PATCH 1/2] Update solution.md --- .../09-size-and-scroll/2-scrollbar-width/solution.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md b/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md index 1ba1e5e57..37585f789 100644 --- a/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md +++ b/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md @@ -1,16 +1,16 @@ -To get the scrollbar width, we can create an element with the scroll, but without borders and paddings. +Щоб отримати ширину смуги прокрутки, ми можемо створити елемент із прокруткою, але без рамок і відступів. -Then the difference between its full width `offsetWidth` and the inner content area width `clientWidth` will be exactly the scrollbar: +Тоді різниця між його повною шириною `offsetWidth` і шириною внутрішньої області вмісту `clientWidth` буде саме смуга прокрутки: ```js run -// create a div with the scroll +// створюємо div з прокруткою let div = document.createElement('div'); div.style.overflowY = 'scroll'; div.style.width = '50px'; div.style.height = '50px'; -// must put it in the document, otherwise sizes will be 0 +// потрібно розмістити його в документі, інакше розміри будуть 0 document.body.append(div); let scrollWidth = div.offsetWidth - div.clientWidth; From df4775f5ece5eabd9e387bcd032ddf9678dad434 Mon Sep 17 00:00:00 2001 From: Roma Herman <57833120+80001@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:42:09 +0200 Subject: [PATCH 2/2] Update solution.md Inserted changes --- .../09-size-and-scroll/2-scrollbar-width/solution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md b/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md index 37585f789..26ea2d16e 100644 --- a/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md +++ b/2-ui/1-document/09-size-and-scroll/2-scrollbar-width/solution.md @@ -1,9 +1,9 @@ Щоб отримати ширину смуги прокрутки, ми можемо створити елемент із прокруткою, але без рамок і відступів. -Тоді різниця між його повною шириною `offsetWidth` і шириною внутрішньої області вмісту `clientWidth` буде саме смуга прокрутки: +Тоді різниця між його повною шириною `offsetWidth` і шириною внутрішньої області вмісту `clientWidth` буде саме ширина смуги прокрутки: ```js run -// створюємо div з прокруткою +// створюємо div з прокруткою let div = document.createElement('div'); div.style.overflowY = 'scroll';