function toTop(){
// 1.无过渡效果
// $(document).scrollTop(0);
// 2.有过渡效果
$("html,body").animate({
scrollTop: 0
}, 800);
}
jQuery实现回到网页顶部方法
最新推荐文章于 2020-12-07 10:36:35 发布
function toTop(){
// 1.无过渡效果
// $(document).scrollTop(0);
// 2.有过渡效果
$("html,body").animate({
scrollTop: 0
}, 800);
}