All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.dom-utils.getNodeScroll.js.flow Maven / Gradle / Ivy

There is a newer version: 2.11.8
Show newest version
// @flow
import getWindowScroll from './getWindowScroll';
import getWindow from './getWindow';
import { isHTMLElement } from './instanceOf';
import getHTMLElementScroll from './getHTMLElementScroll';
import type { Window } from '../types';

export default function getNodeScroll(node: Node | Window) {
  if (node === getWindow(node) || !isHTMLElement(node)) {
    return getWindowScroll(node);
  } else {
    return getHTMLElementScroll(node);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy