zoukankan      html  css  js  c++  java
  • 页面滚动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>
  • 相关阅读:
    Vue数组循环
    vue使用swiper6分页器踩坑
    Vue基础语法(四)
    Vue安装jquery
    Vue基础语法(三)
    Too Rich(贪心加搜索)
    ZOJ Anagrams by Stack(堆栈中的搜索)
    最长子序列和(分治法实现)
    幸运数字(数位dp)
    蜥蜴和地下室(深搜)
  • 原文地址:https://www.cnblogs.com/zinging/p/13712486.html
Copyright © 2011-2022 走看看