From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/ru/web/api/window/scrollto/index.html | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 files/ru/web/api/window/scrollto/index.html (limited to 'files/ru/web/api/window/scrollto/index.html') diff --git a/files/ru/web/api/window/scrollto/index.html b/files/ru/web/api/window/scrollto/index.html new file mode 100644 index 0000000000..30b3a8c73f --- /dev/null +++ b/files/ru/web/api/window/scrollto/index.html @@ -0,0 +1,50 @@ +--- +title: Window.scrollTo() +slug: Web/API/Window/scrollTo +tags: + - Плавная прокрутка + - Плавный скролл +translation_of: Web/API/Window/scrollTo +--- +
{{ APIRef }}
+ +

Описание

+ +

Прокрутка документа до указанных координат.

+ +

Синтакс

+ +
window.scrollTo(x-coord, y-coord)
+window.scrollTo(options)
+ +

Параметры

+ + + +

Пример

+ +
window.scrollTo( 0, 1000 );
+
+// этот код меняет поведение прокрутки на "smooth"
+window.scrollTo({
+    top: 1000,
+    behavior: "smooth"
+});
+ +

Заметки

+ +

Эта функция выполняет то же, что и window.scroll. Остальные функции, связанные с прокруткой window.scrollBy, window.scrollByLines, и window.scrollByPages.

+ +

Спецификация

+ +

{{dom0}}

-- cgit v1.2.3-54-g00ecf