jquery 滚动条底部时自动加载更多信息,
$(window).scroll(function() {
//滚动条到网页头部的 高度,兼容ie,ff,chrome
// var top = document.documentElement.scrollTop + document.body.scrollTop; //??????
//网页的高度
var textheight= $(document).height();// 整个页面的高度
var clt =$(window).height(); // 当前可见页面高度
//滚动条到网页头部的 高度
var top= $(document).scrollTop();// 滚动条距顶部高度
// alert(textheight - top - clt);
if (textheight - top - clt <= 100){
alert('到底部啦!!!!');
//这里调用你加载信息的ajax方法。当然,表单提交也可以,用户体验太差,大数据不行。
}
});