A fork of https://github.com/ueokande/vim-vixen
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.
18 lines
401 B
18 lines
401 B
const get = () => { |
|
let element = document.documentElement; |
|
return { |
|
xMax: element.scrollWidth - element.clientWidth, |
|
yMax: element.scrollHeight - element.clientHeight, |
|
x: element.scrollLeft, |
|
y: element.scrollTop, |
|
}; |
|
}; |
|
|
|
const set = (x, y) => { |
|
let element = document.documentElement; |
|
element.scrollLeft = x; |
|
element.scrollTop = y; |
|
return get(); |
|
}; |
|
|
|
export { get, set };
|
|
|