jQuery 实现在页面中中将 DIV 移动到页面的顶部

假设,我们的页面中有一个 DIV 的 ID 为:dataTabs

可以使用下面的方法,在页面载入的时候将页面移动到顶部。$("html, body").animate({ scrollTop: $('#dataTabs').offset().top - 210 }, 1000);