You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

28 lines
558 B

const SCROLL_DELTA = 48;
const scrollUp = (page, count) => {
let x = page.scrollX;
let y = page.scrollY - SCROLL_DELTA * count;
page.scrollTo(x, y);
};
const scrollDown = (page, count) => {
let x = page.scrollX;
let y = page.scrollY + SCROLL_DELTA * count;
page.scrollTo(x, y);
};
const scrollTop = (page) => {
let x = page.scrollX;
let y = 0;
page.scrollTo(x, y);
};
const scrollBottom = (page) => {
let x = page.scrollX;
let y = page.scrollMaxY;
page.scrollTo(x, y);
};
export { scrollUp, scrollDown, scrollTop, scrollBottom }