0.1.0 • Published 9 years ago

scroll-to-y-el v0.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

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