Smooth cross browser scrollIntoView
npm install scroll-ivSmooth cross browser scrollIntoView
`` js
var scrollIntoView = require('scroll-iv')
// This will smoothly scroll element into view in all browsers using cubic
// bezier animation.
scrollIntoView(domElement)
// you can change scroll speed:
var animation = scrollIntoView(domElement, {
duration: 800 // milliseconds
})
// if you decide that you need to cancel animation:
animation.cancel()
`
Second function argument is compatible with amator configuration
You can pass different easing functions:
` js``
scrollIntoView(domElement, {
easing: 'ease' // default is ease. Possible values:
})
MIT