mirror of
https://git.ari.lt/ari.lt/ari.lt.git
synced 2025-02-05 10:09:23 +01:00
16 lines
413 B
JavaScript
16 lines
413 B
JavaScript
"use strict";
|
|
|
|
var scroll_element = 0;
|
|
const scroll_elements = document.getElementsByClassName("content");
|
|
|
|
function scrollDown() {
|
|
++scroll_element;
|
|
let elem = scroll_elements[scroll_element];
|
|
elem.scrollIntoView({ behavior: "smooth" });
|
|
if (elem) elem.scrollIntoView(true);
|
|
}
|
|
|
|
function scrollUp() {
|
|
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
scroll_element = 0;
|
|
}
|