很久没记笔记了,最近搞起web开发了

<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
function insertcode() {
var $body = $("body");
$body.append('<div style=\" height:1000px; font-size:24px;\">新增项目</div>')
$("#page_tag_load").hide();
}
$(document).ready(function () {
$(window).scroll(function () {
var $body = $("body");
var $html = "";
$html += "<br/>" + ($(window).height() + $(window).scrollTop());
$html += "<br/>window.height: " + $(window).height();
$html += "<br/>body.height: " + $body.height();
$html += "<br/>window.scrollTop: " + $(window).scrollTop();
$("#page_tag_bottom").html($html);
/*判断窗体高度与竖向滚动位移大小相加 是否 超过内容页高度*/
if (($(window).height() + $(window).scrollTop()) >= $body.height()) {
$("#page_tag_load").show();
//setTimeout(insertcode, 1000);/*IE 不支持*/
insertcode();
}
});
});
</script>
</head>
<body>
<div style=" height:1000px; font-size:24px;">新增项目</div>
<div id="page_tag_bottom" style=" width:100%; position:fixed; top:0px; background-color:#cccccc;height:100px;"></div>
<div id="page_tag_load" style=" display:none; font-size:14px;position:fixed; bottom:0px; background-color:#cccccc;height:50px;">加载中...</div>
</body>
</html>

以上代码根据滚动条位置触发一个insertcode(),函数,这个函数可以用ajax,获取服务器接口数据,然后重绘dom

最新文章

  1. PHP数组操作
  2. ORACLE服务端详细安装步骤(配图解)
  3. 剑指offer系列31-----二叉树的下一个节点
  4. python实现的json数据以HTTP GET,POST,PUT,DELETE方式页面请求
  5. Java实现邮箱找回密码 --转载
  6. C++程序设计教程学习(0)-引子
  7. Apache启用GZIP压缩网页传输方法
  8. Palindromes&amp;nbsp;_easy&amp;nbsp;version
  9. 1599: [Usaco2008 Oct]笨重的石子
  10. EasyUI combobox下拉多选框的实现
  11. Nginx 安装详细(一)
  12. makefile:n: *** missing separator. Stop
  13. JavaScript有这几种测试
  14. @Scope 注解
  15. BAT脚本加防火墙455端口
  16. 菜单项onCreateOptionsMenu()和onOptionsItemSelected()的使用
  17. sprint1_11.15燃尽图(第二天)
  18. LeetCode-Sort List[AC源码]
  19. Nginx基础笔记
  20. Alpha阶段项目复审(菜就完事了队)

热门文章

  1. ORACLE大对象存储
  2. Python中函数的知识点
  3. mongodb 备份与还原操作
  4. vue组件中的data与methods
  5. 如何让类数组也使用数组的方法比如:forEach()
  6. 如何通过wlst部署应用程序到weblogic12c上
  7. 低功耗蓝牙UUID三种格式转换
  8. View Controller Programming Guid for iOS 笔记
  9. 十三、细说NULL导致的神坑,让人防不胜防
  10. mniGraffle常用快捷键