| } | } | ||||
| function isvisible(obj) { | function isvisible(obj) { | ||||
| console.log(obj); | |||||
| var top_of_element = $(obj).offset().top; | var top_of_element = $(obj).offset().top; | ||||
| var bottom_of_element = $(obj).offset().top + $(obj).outerHeight(); | var bottom_of_element = $(obj).offset().top + $(obj).outerHeight(); | ||||
| var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); | var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); | ||||
| var top_of_screen = $(window).scrollTop(); | var top_of_screen = $(window).scrollTop(); | ||||
| console.log("screen: " + top_of_screen + " " + bottom_of_screen); | |||||
| console.log("elem: " + top_of_element + " " + bottom_of_element); | |||||
| if (bottom_of_screen > top_of_element && top_of_screen < bottom_of_element) { | if (bottom_of_screen > top_of_element && top_of_screen < bottom_of_element) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| function page_home_scroll() { | function page_home_scroll() { | ||||
| if (isvisible($(".autodoc_template_home_col").last())) { | if (isvisible($(".autodoc_template_home_col").last())) { | ||||
| console.log("scroll to page " + conf.home.curpage); | |||||
| conf.home.curpage++; | conf.home.curpage++; | ||||
| document_load(); | document_load(); | ||||
| } | } |