JSPM

css-scroll-by

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q20443F
  • License MIT

Scroll the page by a given offset using CSS transitions

Package Exports

  • css-scroll-by

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-scroll-by) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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