页面滚动js


     <script type="text/javascript"> var totalHeight = $(document).height();//整个文档高度 var seeHeight = $(window).height();//浏览器可视窗口高度 var thisBodyHeight = $(document.body).height();//浏览器当前窗口文档body的高度 var totalBodyHeight = $(document.body).outerHeight(true);//浏览器当前窗口文档body的总高度 包括border padding margin var thisWidth = $(window).width(); //浏览器当前窗口可视区域宽度 var thisDocumentWidth = $(document).width();//浏览器当前窗口文档对象宽度 var thisBodyWidth = $(document.body).width();//浏览器当前窗口文档body的宽度 var totalBodyWidth = $(document.body).outerWidth(true);//浏览器当前窗口文档body的总宽度 包括border padding margin var scrollTop = $(window).scrollTop();//浏览器可视窗口顶端距离网页顶端的高度(垂直偏移) //添加滚动事件 $(window).scroll(function(){ scrollTop = $(window).scrollTop(); totalHeight = $(document).height(); if(scrollTop+seeHeight+50>totalHeight){ allnewsmore() } }) </script>
原文地址:https://www.cnblogs.com/zinging/p/13712486.html