JSPM

window-scroller

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q55254F
  • License MIT

window scrolling animating

Package Exports

  • window-scroller

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 (window-scroller) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

window-scroller

Credit:

@shunryu111 http://stackoverflow.com/users/2630316/shunryu111

Based on:

http://stackoverflow.com/a/26798337/5068410

install

npm install window-scroller --save

usage

import Scroller from 'window-scroller';
OR
const Scroller = require('window-scroller');

Scroller.to(500).scroll()
Scroller.to(500).speed(700).scroll()
Scroller.to(500).easing('easeOutSine').scroll();
Scroller.to(500).speed(700).easing('easeInOutSine').scroll();

const element = document.getElementById('rolling');
Scroller.to(element).scroll()
Scroller.to(element).speed(700).scroll()
Scroller.to(element).easing('easeInOutQuint').scroll();
Scroller.to(element).speed(700).easing('easeInOutQuint').scroll();

options

speed (Integer):

  • 0 -> inf

easing (String):

  • easeOutSine
  • easeInOutSine
  • easeInOutQuint

to (Integer | Element):

  • DOM Element
  • Integer