Scroll to an anchor if possible.
var scrollToAnchor = require('scroll-to-anchor')
scrollToAnchor(window.location.hash)
scrollToAnchor(window.location.hash, { behavior: 'smooth' })
scrollToAnchor(anchor, options)Scroll to an anchor if possible. Does nothing if no anchor is provided or if the anchor doesn't exist on the page.
You can also specify the same options as the scrollIntoView method which allows for more positioning options and scroll behaviour changes.