Scroll
Extends the Animation utility and gives you the ability to animate scrolling:
import { ScrollAnimation } from 'oblik/utils/scroll'
import { easeOutExpo } from 'oblik/utils/easings'
let animation = new ScrollAnimation({
offset: 600,
duration: 1200,
easing: easeOutExpo
})
animation.run()
You can also use the scrollTo()
export as well:
import { scrollTo } from 'oblik/utils/scroll'
import { easeOutExpo } from 'oblik/utils/easings'
scrollTo({
offset: 600,
duration: 1200,
easing: easeOutExpo
})
# Options
#
duration
Length of the animation.
Required.
#
easing
An easing function.
Default: linear
#
target
Element that should be scrolled into view.
Default: undefined
#
offset
If target
is specified, offset
will simply be added to the target element's position. Otherwise, it will scroll to offset
pixels past the document top.
Default: 0
#
interruptible
Whether the scroll animation can be interrupted by user input, such as mouse scroll or touch.
Default: true