GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing javascript.info — Load images with a callback back to the lesson Load images with a callbackimportance: 4 Normally, images are loaded when they are created. So when we add To show an image immediately, we can create it “in advance”, like this:
The browser starts loading the image and remembers it in the cache. Later, when the same image appears in the document (no matter how), it shows up immediately. Create a function For instance, this will show an
In case of an error, the function should still assume the picture “loaded”. In other words, the The function is useful, for instance, when we plan to show a gallery with many scrollable images, and want to be sure that all images are loaded. In the source document you can find links to test images, and also the code to check whether they are loaded or not. It should output The algorithm:
|
| You are visitor 01402503 — 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. |