...

View Full Version : Page loading idea



noPCtoday
07-18-2007, 09:14 PM
I want to make a page loading function for my website,

1.before all, I want it to load a navigation bar,
2.then, the page loads the text & css, but will not display them untill loading is finished.
3.then, load images, but will not display them untill loading is finished.
4.lastly, when image is finished, i want it to load Prototype library and other stuff.

and Also there is a bar indicates if its loading txt/image/javascript

I don't really know where to start with, can you guys give me some hints on these functions? also How do I control the loading order?

rnd me
07-19-2007, 04:28 AM
I want to make a page loading function for my website,


and Also there is a bar indicates if its loading txt/image/javascript

I don't really know where to start with, can you guys give me some hints on these functions? also How do I control the loading order?

i can't really code the thing for you, but i'll give you some of the anwsers you need.

. How do I control the loading order? if you use seperate script tags to do each section. they will execute in top-down order.

4.lastly, when image is finished, i want it to load Prototype library and other stuff.
you need a body.onload event-
add a script tag to prototype as the last line of your onload function.

1.before all, I want it to load a navigation bar,
two possibilities-
1. use an iframe to display your html-based navbar.
2. encode the navbar html (escape for instance), and doc.write it first thing.

2.then, the page loads the text & css, but will not display them untill loading is finished.
3.then, load images, but will not display them untill loading is finished.

doc.write aether a string with the encoded html, or an synchron jax'ed file , the top element of which is styled to "display:none"
then, in your onload function, change the element's display style to "block". if your images are part of the html, they will load.

body.onload only fires after all images and scripts have finished.

the progess bar could be doc.write'd text input, the value of which is changes as the script writes the page, and hidden upon completion.


good luck.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum