I have the a page loading 5 rows of results, and 5 more on click.
All I want to do is show the 5 more on scroll, like a lazy loader, instead of on click...thanks for any help.
$(function() {
initShowMore();
$("span#showMore a.moreResults").click(loadMoreResults);
});
function initShowMore() {
var has_more = $("form#data input[name=has_more_results]").val();
if (has_more) {
$("table span#showMore").show();
} else {
$("table span#showMore").hide();
}
}
function loadMoreResults() {
if (loading) {
return;
}
loading = true;
var has_more = $("form#data input[name=has_more_results]").val();
var page = parseInt($("form#data input[name=page]").val());
var data = gatherQueryParams();
data.page = page + 1;
append = true; // global
load(data);
}