animated-smooth-scroll-to

1.0.3 • Public • Published

Animated Scroll

An ES6 plugin written in TypeScript to replicate the easy functionality of the jQuery animate method for smooth scrolling.

Usage

animatedScroll(position, duration)

where..

  • position is the y-offset on the page where you want to scroll to (in px).

  • duration is how long the scroll animation should take (in milliseconds).

Example

animatedScroll(1400, 400)

Tips

The position value of any HTMLElement can easily be extracted by making use of the getBoundingClientRect() method.

Readme

Keywords

none

Package Sidebar

Install

npm i animated-smooth-scroll-to

Weekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

4.78 kB

Total Files

9

Last publish

Collaborators

  • lkllnd