Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    39
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Page loading idea

    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?
    Last edited by noPCtoday; 07-18-2007 at 10:19 PM.

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,292
    Thanks
    10
    Thanked 583 Times in 564 Posts
    Quote Originally Posted by noPCtoday View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •