Skip to content

Robinnnnn/scroll-to

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scroll-to

Smooth window scroll to position with requestAnimationFrame and Tween.

Installation

$ npm install @robinnnnn/scroll-to

API

scrollTo(x, y, [options])

Scroll to the given point (x, y) with the given options:

  • ease easing function defaulting to "out-circ" (view ease for more)
  • duration animation duration defaulting to 1000 milliseconds
  • cancelOnUserScroll cancels scrolling animation when user interruption is detected; defaults to false
var scrollTo = require('scroll-to');

scrollTo(500, 1200, {
  ease: 'out-bounce',
  duration: 1500,
  cancelOnUserScroll: true
});

License

MIT

About

Smooth window scrolling with requestAnimationFrame and the Tween component

Resources

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 56.4%
  • HTML 37.4%
  • Makefile 6.2%