GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing ko.javascript.info — Endless page 돌아가기 Endless page중요도: 5 Create an endless page. When a visitor scrolls it to the end, it auto-appends current date-time to the text (so that a visitor can scroll more). Like this: Please note two important features of the scroll:
So, “scrolling to the end” should mean that the visitor is no more than 100px away from the document end. P.S. In real life we may want to show “more messages” or “more goods”. The core of the solution is a function that adds more dates to the page (or loads more stuff in real-life) while we’re at the page end. We can call it immediately and add as a The most important question is: “How do we detect that the page is scrolled to bottom?” Let’s use window-relative coordinates. The document is represented (and contained) within We can get window-relative coordinates of the whole document as For instance, if the height of the whole HTML document is
If we scroll
When we scroll till the end, assuming that the window height is
Please note that the We can obtain the window height as For our task, we need to know when the document bottom is not no more than So here’s the function:
|
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |