views:

7160

answers:

4

Hello!

I'm working on a site which contains a whole bunch of mp3s and images, and i'd like to display a loading gif while all the content loads. I have no idea how to achieve this, but I do have the animated gif I want to use. any help?

Thanks!

+4  A: 
mmattax
+1  A: 

I'd love to do this without getting into ajax, as the site is literally completed, and I don't really feel like learning a new language and doing a complete site overhaul. I just need to have a gif display while the images and mp3s are loading behind the scenes. I'm comfortable in XHTML, Javascript and CSS. Any help?

"Loading behind the scenes" is what ajax is all about...how are you lading content now ?
mmattax
I suppose currently I'm just loading the content in XHTML...it's on the page, and when it's ready, it shows up. No tricks. I think I may have found a javascript solution that waits until all the content on the page is loaded before displaying the page...know anything about that?
If your loading one big XHTML file, there is no "behind the scenes loading" going on...so there is no way to display an image to the user until the entire page is loaded. You need to split pieces of your page and load them independently via an ajax method...
mmattax
actually that's exactly what I want. One loading image to appear while the whole page loads. how would i do that?
You can't do something like that...where would you place the image if the *whole* page is loading?, you will need to load partial pages with ajax...
mmattax
+1  A: 

There is an example here along with some other stuff http://destraynor.com/serendipity/index.php?/archives/29-AJAX-for-the-beginner.html

For a nice gif you can check out http://ajaxload.info/

Morph