@jfm/scroll-to

0.1.2 • Public • Published

scroll-to

Scrolls to element smoothly.

Demo

Install

npm install @jfm/scroll-to

Import

import { scrollToElement, scrollToTop, scrollToBottom } from '@jfm/scroll-to'

APIs

scrollToElement

scrollToElement(element, [offset])

element: Element. The element you want to scroll to. offset: Number. Optional. Leaves some spaces between viewport's top and the element.

scrollToTop

scrollToTop()

Scrolls to top.

scrollToBottom

scrollToBottm()

Scrolls to bottom.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @jfm/scroll-to

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

7.55 kB

Total Files

10

Last publish

Collaborators

  • jiangfengming