|
|
@@ -52,14 +52,14 @@ function change_page() { |
|
|
|
} |
|
|
|
|
|
|
|
function isvisible(obj) { |
|
|
|
console.log(obj); |
|
|
|
console.log(obj); |
|
|
|
var top_of_element = $(obj).offset().top; |
|
|
|
var bottom_of_element = $(obj).offset().top + $(obj).outerHeight(); |
|
|
|
var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); |
|
|
|
var top_of_screen = $(window).scrollTop(); |
|
|
|
|
|
|
|
console.log("screen: " + top_of_screen + " " + bottom_of_screen); |
|
|
|
console.log("elem: " + top_of_element + " " + bottom_of_element); |
|
|
|
console.log("elem: " + top_of_element + " " + bottom_of_element); |
|
|
|
|
|
|
|
if (bottom_of_screen > top_of_element && top_of_screen < bottom_of_element) { |
|
|
|
return true; |
|
|
@@ -68,13 +68,12 @@ function isvisible(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
function page_load_home() { |
|
|
|
|
|
|
|
document_load(0); |
|
|
|
} |
|
|
|
|
|
|
|
function document_load(page) { |
|
|
|
if (!page || page == 0) { |
|
|
|
$('#autodoc_home_body').html(''); |
|
|
|
$("#autodoc_home_body").html(""); |
|
|
|
page = 0; |
|
|
|
} |
|
|
|
|
|
|
@@ -126,14 +125,10 @@ function document_load(page) { |
|
|
|
$(row).append(col); |
|
|
|
}); |
|
|
|
$("#autodoc_home_body").append(row); |
|
|
|
// continue to load until out of browser. |
|
|
|
if (isvisible($.find(".autodoc_template_home_col").last())) { |
|
|
|
document_load(page + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
// continue to load until out of browser. |
|
|
|
console.log($('.autodoc_template_home_col')); |
|
|
|
console.log($('#autodoc_home_body').parent()); |
|
|
|
console.log($); |
|
|
|
console.log($('#autodoc_home_body').find('.autodoc_template_home_col')); |
|
|
|
if (isvisible($.find(".autodoc_template_home_col").last())) { |
|
|
|
document_load(page + 1); |
|
|
|
} |
|
|
|
} |