返回顶部

  作者:chrispy

//返回顶部function smoothscroll() {var currentScroll = document.documentElement.scrollTop || document.body.scrollTop;if (currentScroll > 0) {window.requestAnimationFrame(smoothscroll);window.scrollTo(0, currentScroll - (currentScroll / 10));

//返回顶部

function smoothscroll() {

var currentScroll = document.documentElement.scrollTop || document.body.scrollTop;

if (currentScroll > 0) {

window.requestAnimationFrame(smoothscroll);

window.scrollTo(0, currentScroll - (currentScroll / 10));

}

}


有用  |  无用

猜你喜欢