var layer_load ; function resetWin(){ $("body").height($(window).height()); } $(function(){ resetWin(); }); var bList = { batch_ind : "第一批次", page_num : 0 } //更改批次 function pici_tab(me,ind){ bList.page_num = 0; $("#piciList").html(""); $(me).addClass("self-active").siblings().removeClass("self-active"); bList.batch_ind = ind; request(); } function roomMsg(id,data){ localStorage.setItem("data",JSON.stringify(data)); window.location.href="houseDetail.html?id_="+id; } //请求 function request(){ bList.page_num += 1; layer_load = layer.open({ type: 2, shade: 'background-color: rgba(0,0,0,.2)', content: '加载中' }); $.get(basePath + "buildingList",bList,function(data){ buildingList(data); },"json"); } //随机边框色 function RandomNum(Min,Max){ var Range = Max - Min; var Rand = Math.random(); var num = Min + Math.round(Rand * Range); return num; } function split_str(a){ if(a == "null" || a == null){ return "无"; }else if(a.split("(")[0] != ""){ return a.split("(")[0]; }else{ return a; } } function buildingList(data){ if(data.length != 0){ var str = ""; for(var i = 0;i'; str += ''; str += ''; } $("#piciList").append(str); }else{ layer.open({ content: '已加载全部', skin: 'msg', time: 2 //2秒后自动关闭 }); } layer.close(layer_load); } window.onload = function(){ request(); }