0.1.2 • Published 4 years ago

@jfm/scroll-to v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 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