jquery.isload.js 889 B

123456789101112131415161718
  1. if(performance.navigation.type!=2){delCookie("ProjectListPageIndex");sessionStorage.removeItem("ProjectListAjaxData");}
  2. var ProjectListAjaxData = sessionStorage.getItem("ProjectListAjaxData");
  3. if (ProjectListAjaxData == null) {ProjectListAjaxData = "";}
  4. if (getCookie("ProjectListPageIndex")!= null) { var i = getCookie("ProjectListPageIndex") ;}else{var i = 2; }
  5. var isload = false;
  6. $(function() {
  7. var totalpage = 50;
  8. var winH = $(window).height();
  9. $(window).scroll(function() {
  10. if (i < totalpage) {
  11. var pageH = $(document.body).height();
  12. var scrollT = $(window).scrollTop();
  13. var aa = (pageH - winH - scrollT) / winH;
  14. if (aa < 0.01 && !isload ) {getJson(i)}} else {showEmpty();}
  15. });
  16. if (ProjectListAjaxData != null && ProjectListAjaxData != "") { $("#homelist").append(ProjectListAjaxData); }else {ProjectListAjaxData = ""; }
  17. });
  18. function showEmpty() {$("#nodata").show();}