点击按钮跳到当前页面指定的div和跳到顶部或底部

function goTop() {
$('html, body').animate({scrollTop:0}, 'slow'); 
}
function goDiv(div) {
var a = $("#"+div).offset().top;
$("html,body").animate({scrollTop:a}, 'slow'); 
}
function goBottom() {
window.scrollTo(0, document.documentElement.scrollHeight-document.documentElement.clientHeight); 
}
原文地址:https://www.cnblogs.com/shenyixin/p/2854899.html