Scroll to the current anchor in the url if possible
npm install scroll-to-anchorScroll to an anchor if possible.
js
var scrollToAnchor = require('scroll-to-anchor')
scrollToAnchor(window.location.hash)
scrollToAnchor(window.location.hash, { behavior: 'smooth' })
``You can also specify the same options as the scrollIntoView method which allows for more positioning options and scroll behaviour changes.
[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/scroll-to-anchor.svg?style=flat-square
[3]: https://npmjs.org/package/scroll-to-anchor
[4]: https://img.shields.io/travis/yoshuawuyts/scroll-to-anchor/master.svg?style=flat-square
[5]: https://travis-ci.org/yoshuawuyts/scroll-to-anchor
[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/scroll-to-anchor/master.svg?style=flat-square
[7]: https://codecov.io/github/yoshuawuyts/scroll-to-anchor
[8]: http://img.shields.io/npm/dm/scroll-to-anchor.svg?style=flat-square
[9]: https://npmjs.org/package/scroll-to-anchor
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard