0.1.2 • Published 5 years ago

@jfm/scroll-to v0.1.2

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

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