Provide thousands of free JavaScript code examples, DHTML, HTML JavaScript Tutorials, Reference and Help. JavaScriptBank.com is the best JavaScript resources
There is a function in the script called
action(). This function is run once all the images are done loading.
Currently, this function is set to hide the bar, but can be changed easily. See
the .js file for more directions on how to use this.
You can specify an action to take place when the bar is clicked with the mouse.
The action(s) to take place when this happens is determined by a function called
clickBar(). This can be used to cancel the progressbar if the user clicks
it. If you do not want anything to happen, just remove everything in this
function.
There is a bug when using NS6: When the user goes back to the page or refreshes
the page, the bar never disappears. You can click the bar with the mouse to
force it to disappear or you can mess around with the history object so you
can't return to the progressbar page.
Incidentally, the images being cached in this example are just arbitrary images
of about 4Kbytes apiece to illustrate the loading process.