Skip to content
/ scroll Public
forked from bloodyowl/scroll

Smooth scrolling to given coordinates for the browser

License

Notifications You must be signed in to change notification settings

neo-z/scroll

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Smooth scrolling to given coordinates for the browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%