The component that animates the vertical scrolling of a target Element as well as the <window> on most browsers.
The fully reworked component for vertical scrolling animation is an essential part of KUTE.js.
The KUTE.js Scroll Property component enables animation for the vertical scroll of a target Element or the <window> on most browsers.
The vertical scrollling animation is a popular choice to spice up the in-page navigation, and most websites use a Back To Top button for scrolling all the way back to top. For this reason, our component doesn't support horizontal scrolling animation.
The component also uses passive event option for best possible performance along with other improvements like removed the need to use additional CSS or the use of data-scrolling attribute on the <body> element.
On animation start, the component will lock down all possible pointer events of the animation target to avoid any unwanted animation glitches.
// all websites to top button
KUTE.to(window,{scroll:0}).start()
// scroll to a certain element
KUTE.to(window,{scroll: document.getElementById('myElement').offsetTop }).start()
// scroll to top an overflowing target element
KUTE.to('#myElement',{scroll: 0 }).start()
<a>Back to top</a> button at the bottom, just in case you didn't notice.