Forum Moderators: open

Message Too Old, No Replies

Preload ALL images before the rest of page?

         

df_sean

2:32 am on Sep 23, 2004 (gmt 0)

10+ Year Member



Is it possible? I'd rather have my page wait a few more seconds before anything loads at all, then just POP onto the screen all at once. Any way to do that?

Rambo Tribble

3:27 am on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a thought, but you might try:
<style type="text/css">
body{visibility:hidden;}
</style>

and in the document:
<body id="pgBod" onload="document.getElementById('pgBod').style.visibility='visible';">

df_sean

9:46 am on Sep 23, 2004 (gmt 0)

10+ Year Member



Hey that's an interesting idea -- hadn't thought of using CSS. But my concern is that this means JavaScript is *required* in order to see the page. I'd prefer for it to fail more gracefully, load the images in advance if JS is enabled, load normally (one by one) if not. Any other ideas?

Lord Majestic

9:52 am on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd rather have my page wait a few more seconds before anything loads at all, then just POP onto the screen all at once.

You'd rather... but what about your users? So much time was spent on developing progressive rendering that shows some bits quickly to start reading while the rest is downloaded, and you want to override all that in one go and force people wait before showing whole lot right in their face.

In games all objects drawn on a hidden scene before showing it to the end user so that there is no flickering, but web is not the same thing. People on broadband expect page to appear in a fraction of a second, with some images downloaded as they scan the text - if they have to wait more than a second then this would cause unease and lack of comform they so used to.

Its not about how to do it, its whether it should be done in the first place, which IMO is totally unnecessary unless your users demand that faeture from you.

df_sean

10:46 am on Sep 23, 2004 (gmt 0)

10+ Year Member



Hey Lord Majestic, really good points IMO. And I agree with you 100%. The thing is, the site is for a web hosting company which is based on the opposite side of the world from where the servers are. So in this case, to give the impression of a "faster server", I'd like for the viewers to see the whole page at the same time rather than watch each image load one at a time which makes it *look* like a slow server (even though the server is very fast).

Larryhat

11:00 am on Sep 23, 2004 (gmt 0)

10+ Year Member



I'd be cautious. If I wait more than a few seconds before ANYTHING shows up, I usually back out.

I'd me inclined to give the viewer something to read first, while the images are loading. Then they might not notice the wait. - Larry

PCInk

11:02 am on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



But if it takes 15 seconds to load the page (say, on dial up), then 15 seconds of blank page would make your servers look APPALLING.

If I were looking for a webhosting company, I would want near instant response from their own website.

df_sean

11:59 am on Sep 23, 2004 (gmt 0)

10+ Year Member



Good points guys. I'll definitely consider that. Cheers.

Leosghost

12:36 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a site which does this ( and whilst the large images are loading it loads thumbs ) ..you can select any thumb while the process is happening and thus change the large image ...you can do this as many times as you want
..
the whole thing is javascipt based ..small file about 2kb

But ...the backout "I'm bored /don't wanna wait" rate is about 70%..even with anigifs and status bar scripts to say whats happening etc....

not counting the drop off in visitors with javascript blocked since the IE SP2 fiasco...

site is hosted on a server in the USA ..I'm in Europe ..it's frustrating even for me ...I am near finished the new version with no javascipt etc etc ...

If I were you I would not go this route ...use progressive jpegs instead ..that way they get something to look at and some text to read ..99% of your visitors don't see any difference between a site hosted in the USA and one hosted in my case in France ( I do ..the server is much cheaper in the USA for much better spec and the "delay" is only one or two milliseconds different ...if any ) ..

Rambo Tribble

1:24 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To satisfy your requirement that the page display without JavaScript, just place a second style sheet after the first surrounded in <noscript></noscript> tags that makes the body visible.

Rambo Tribble

2:40 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A potential way to get immediate response and still have your fancy page snap is to milk the principle of the splash screen; load a very simple page with just some brief text (like "Welcome to the site for Heretical Jihad," or whatever) and use a meta refresh tag to immediately start loading your main page.

You might also do this by loading a visible div within the main page while using another, hidden div that contains all the main content, then swap visibility at onload. Results might be a bit more variable this way, however, but you would cut down on HTTP requests, TCP slow-start phase issues, etc. Again, use rules within noscript tags to hide the splash div (I'd use display:none; slightly more efficient) and show the main. This last, of course, for those who can't handle the script (imagine me doing my best Jack Nicholson for that final bit).

Leosghost

2:47 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



consider it "imagined" ...lol

use a meta refresh tag to immediately start loading your main page.

Corse the "unethical" would also optimise their new "doorway" page for KW...cept I seem to remember that something or other now blocks intant meta refresh on onloads ..and Google views them with a very jaundiced eye...had me a "doozy" ..got scared and pulled it ..

[edited by: Leosghost at 2:53 pm (utc) on Sep. 23, 2004]

Bernard Marx

2:50 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You want the script?
...you can't handle the script!