UNPKG

905 BTypeScriptView Raw
1/**
2 * Scroll Module. This class contains 4 simple static functions
3 * to be used to access Element.scrollTop/scrollLeft properties.
4 * To solve the inconsistencies between browsers when either
5 * document.body or document.documentElement is supplied,
6 * below logic will be used to alleviate the issue:
7 *
8 * 1. If 'element' is either 'document.body' or 'document.documentElement,
9 * get whichever element's 'scroll{Top,Left}' is larger.
10 * 2. If 'element' is either 'document.body' or 'document.documentElement',
11 * set the 'scroll{Top,Left}' on both elements.
12 */
13declare namespace Scroll {
14 function getTop(element: HTMLElement): number;
15 function setTop(element: HTMLElement, newTop: number): void;
16 function getLeft(element: HTMLElement): number;
17 function setLeft(element: HTMLElement, newLeft: number): void;
18}
19
20// tslint:disable-next-line export-just-namespace
21export = Scroll;