scroll-xy

1.1.0 • Public • Published

scroll-xy Build Status

Get the current x/y scroll position and scroll maximum

Install

$ npm install --save scroll-xy

Usage

var scrollPosition = require('scroll-xy')
 
scrollPosition()
//=> {x, y, maximum: {x, y}} for window
 
scrollPosition(element)
//=> {x, y, maximum: {x, y}} for element

API

scrollPosition(element) -> object

Returns an {x, y, maximum: {x, y}} object where values are integers.

element

Type: HTMLElement Default: window

A DOM element, defaulting to window which has special handling.

License

MIT © Ben Drucker

Readme

Keywords

Package Sidebar

Install

npm i scroll-xy

Weekly Downloads

11

Version

1.1.0

License

MIT

Last publish

Collaborators

  • bendrucker