/**
* Created by libtop on 17/3/14.
*/
// 加載刷新。
function refresh(refresh,loadmore) {
$(window).scroll(function(){
console.log('正在滑動f');
var scrollTop = $(this).scrollTop(); //滾動條距離頂部的高度
var scrollHeight = $(document).height(); //當前頁面的總高度
var clientHeight = $(this).height(); //當前可視的頁面高度
// console.log("top:"+scrollTop+",doc:"+scrollHeight+",client:"+clientHeight);
if(scrollTop + clientHeight >= scrollHeight){ //距離頂部+當前高度 >=文檔總高度 即代表滑動到底部 count++; //每次滑動count加1
// filterData(serviceTypeId,industryId,cityId,count); //調用篩選方法,count為當前分頁數
console.log('下拉');
if(loadmore){
loadmore();
}
}else if(scrollTop<=0){
//滾動條距離頂部的高度小於等於0 TODO
//alert("下拉刷新,要在這調用啥方法?");
console.log('上拉');
if(refresh){
refresh();
}
}
});
}
//調用
refresh(fn1,fn2);