Nougat Predominant Middleware
Miss any of our Open RFC calls?Watch the recordings here! »

scroll-to-y-el

0.1.0 • Public • Published

scrollToY

Vertically scroll to an Element using requestAnimationFrame.

Inspired by http://stackoverflow.com/a/26808520.

Usage

// In node
var scrollToY = require('scroll-to-y');
// In the browser just include the source file
 
scrollToY('someElementId'), {
  easing: function(pos) {
    return -(Math.pow((pos - 1), 2) - 1);
  },
  speed: 1000,
  offset: 100
});

Easing functions

MIT. (c) 2015 Darío Javier Cravero dario@uxtemple.com

Install

npm i scroll-to-y-el

DownloadsWeekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • avatar