I want to load more data by clicking this button, but I can"t control its hiding. How to solve this problem?
function scrollFunc (e) {
e = e || window.event;
if (e.wheelDelta) { //:IE
if (e.wheelDelta > 0) { //
console.log("");
$(".loadMore").hide();
}
if (e.wheelDelta < 0) { //
console.log("");
$(".loadMore").show();
}
} else if (e.detail) { //Firefox
if (e.detail> 0) { //
console.log("");
$(".loadMore").hide();
}
if (e.detail< 0) { //
console.log("");
if($(window).scrollTop()+$(window).height()==$(document).height()){
$(".loadMore").show();
}
}
}
}
}
in the following code, size is the number of data items requested per click, and sum is the number of data items returned after each click
if(size>sum){
if((offset*size)>sum){
$(".loadMore").hide();
}else{
$(".loadMore").show();
}
:2