css-scroll-by

0.1.0 • Public • Published

css-scroll-by

Scroll the page by a given offset using CSS transitions

Manipulates the margin-top and margin-left style properties, then when the animation is complete, removes the margins, and moves the window scroll directly.

NPM

API

var scrollBy = require('css-scroll-by')

scrollBy(offset, duration)

offset can be a number (representing Y scroll) or an array containing [x,y] offset.

duration is the number of milliseconds the animation should take to complete.

Example

$ npm install beefy -g
$ npm run example

Versions

Current Tags

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

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    2
  • 0.0.1
    0
  • 0.0.0
    2

Package Sidebar

Install

npm i css-scroll-by

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • mmckegg