/scroll-to-y

Performant scroll to an arbitrary Y

Primary LanguageJavaScriptMIT LicenseMIT

Scroll to y

var scrollToY = require('scroll-to-y');

// scrollToY(scrollTargetY, speed, easing);
// 
// scrollTargetY: the target scrollY property of the window
// speed: time in pixels per second
// easing: easing equation to use

scrollToY(0, 1500, 'easeInOutQuint');

Easing Equations

  • easeOutSine
  • easeInOutSine
  • easeInOutQuint