Bladeren bron

test

master
Pascal Gloor 5 jaren geleden
bovenliggende
commit
e784ae9a01
1 gewijzigde bestanden met toevoegingen van 7 en 12 verwijderingen
  1. 7
    12
      www/js/autodoc.js

+ 7
- 12
www/js/autodoc.js Bestand weergeven

@@ -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);
}
}

Laden…
Annuleren
Opslaan