设置页面加载时滚动条自动滚到底的方法:
jquery:
复制代码 代码如下:
$(function(){
var h = $(document).height()-$(window).height();
$(document).scrolltop(h);
});
javascript:
复制代码 代码如下:
window.onload = function(){
var h = document.documentelement.scrollheight || document.body.scrollheight;
window.scrollto(h,h);
}
以上2种方法均可以实现页面加载时滚动条自动滚动到底,小伙伴们根据自己的实际需求,自由选择吧