设置页面加载时滚动条自动滚到底,两种实现方法:
1,jquery:
复制代码 代码示例:
$(function(){
var h = $(document).height()-$(window).height();
$(document).scrollTop(h);
});
2,javascript:
复制代码 代码示例:
window.onload = function(){
var h = document.documentElement.scrollHeight || document.body.scrollHeight;
window.scrollTo(h,h);
}