treehouse : what would you like to learn today?
Web Design Web Development iOS Development

preloading a webpage

  • can anyone help me in preloading a webpage(and show an ajax loading gif)

    thanks

    nidhin
  • Are you wanting to preload the webpage for the same reason you might want to preload an image? To make it load faster. If so, could you just load the page in a iframe and not display the iframe on screen?
  • http://net.tutsplus.com/tutorials/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/
    This NETTUTS tutorial might help
  • One trick is placing an absolute positioned div right after the body opening tag, give it a with and height of 100%. Put something fancy in it, some loader gif image, and make it dissapear when the entire document was loaded using javascript.

    It's kinda simple and maybe old, so you should have a look at other solutions as well
  • Hi all

    I'm a new to jquery and have some trobles to integrate a preloader or least an wait handel so the page will wait for 5s. until it goes of with the full content. I found some nice preloader but it doesen't work with my jquery imagefader i used.
    Can anyone help me to do a wait for 5s. until a <div> is showing?
    Thanks
  • I did now a wait with a timeout:
    setTimeout (function()

    That woked pretty well.