bloody-scroll

1.0.1 • Public • Published

bloody-scroll

Smooth scrolling to given coordinates for the browser

Build Status

Install

$ npm install --save bloody-scroll

Import

import scroll from "bloody-scroll"

API

promise scroll({ x: number, y: number}, duration = 300)

Arguments

  • coords.x : (Number) Horizontal target for scroll.
  • coords.y : (Number) Vertical target for scroll.
  • duration : (Number) Transition duration.

Returns

  • promise : (Promise) A promise that is fulfilled once the transition is done.

Example

scroll({ x: 0, y: 1000 }, 1000)
scroll({ x: 1000 }, 1000)
scroll({ y: 400 }, 1000)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 1.0.0
    1
  • 0.2.1
    25
  • 0.2.0
    2

Package Sidebar

Install

npm i bloody-scroll

Weekly Downloads

30

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bloodyowl