scrollIntoView()窗口滚动

1、某DIV窗口滚动到顶部:

document.getElementById("某DIV的ID").scrollIntoView(true);

2、某DIV窗口滚动到底部:

document.getElementById("某DIV的ID").scrollIntoView(false);

3、jquery中跳转到顶部

 $('html,body').animate({scrollTop: 0}, 100)

 $('html,body').animate({scrollTop: $('xxx').offset().top}, 100) // 跳转到某点

原文地址:https://www.cnblogs.com/waitingbar/p/7028356.html