vue.js Back to the top

hangleGoUp () {
the console.log ( "Start")
the let nowTop = document.body.scrollTop || document.documentElement.scrollTop; // get the current position of the scrollbar
IF (nowTop> 0) {
window.requestAnimationFrame to (this.hangleGoUp) ;
the window.scrollTo (0, nowTop - (nowTop / 50));
}
the console.log ( "end")
}

Guess you like

Origin www.cnblogs.com/supereast/p/11703226.html
Recommended