PDA

View Full Version : wait for background load before display site



alapimba
July 16th, 2007, 12:46 PM
Hello
i have a background that is very heavy, and when someone goes to my site the background allways loads in the end of everything else and i don't want it this way.

Theres something i can do to make everything wait for the background load to then display the tables and etc from the site?

thats all folks
July 16th, 2007, 01:15 PM
I've never seen this done, and making people wait will make them leave, I would rather see something then nothing when I come to a site. what kind of bg is it?

alapimba
July 16th, 2007, 01:22 PM
the background has 1500x1500 pixels and 800kb :(

I can't make it smaller than 800kb.

I did it with 1500x1500 because i want everybody to see it without repeat the background horizontal or vertical.

:S

thats all folks
July 16th, 2007, 01:27 PM
Do you have a link so I can see an example, this might help others think of ways to get around it.

Digitalosophy
July 16th, 2007, 02:16 PM
the background has 1500x1500 pixels and 800kb :(

I can't make it smaller than 800kb.

I did it with 1500x1500 because i want everybody to see it without repeat the background horizontal or vertical.

:S

Surely there is a better method than that. Let's see what you're working with.

irrationalistic
July 16th, 2007, 03:07 PM
There are a great deal of image preloader scripts out there. Maybe you could use one of these types of scripts to load your background. That way, if you give all your main body elements a "display: none" style, nothing will show except a "loading..." image if you specify one. Once the background has finished loading, the javascript should be able to call a function where you would just change the display type from hidden to show all the elements of your page...

Hope that makes sense...

zerokilled
July 16th, 2007, 11:55 PM
irrationalistic, that was the same idea that i had showed to others. however, it still not a good option depending on which function programmer will rely. for example, web browser developer provide an Image object that are common in most javascript capable browser. nevertheless, web browser developer also provide extended function and property that are browser specific. for example, ie6 javascript implementation define the property 'complete' on Image object, but this property isn't standard, so is useless to rely on this property.

the solution that i had showed to other rely on the event onload. the event is launched when all content is loaded in browser, so you could maintain a hidden div until the event is fired. right now, i can't remember if browser take into consideration content loaded on css document. worth to try.

i will not say this is the only solution, but so far this has been a functional solution that has worked for me on this common purpose. in conclusion and with all due respect to alapimba and those who are looking for this solution, on my opinion i prefer to edit the bg rather than rely on a stupid script that display the whole content in one 'shot or chunck' because people don't like to wait unless they know which is the bennefit, content or service.

alapimba
July 17th, 2007, 07:07 AM
it's too late to change the background. my client just loved it.
I can save some KB making it smaller than 1500x1500.
Whats your advice? the background can't repeat horizontal or vertically so i wanted it as big as possible... till which screen resolution i should worry about? i guess theres a few guys out there with 1600x1200 already.. so i guess 1500 horizontal i have to keep.. maybe reduce verticaly? :S

Cello
July 17th, 2007, 07:28 AM
Could you not scale the image to suit the browser window? That might allow a smaller pixel dimension and therefore the file size...

There's a good thread on kirupa somewhere about scaling ... - yes, here it is: http://www.kirupa.com/forum/showthread.php?t=252734

alapimba
July 17th, 2007, 07:38 AM
humm.. i guess i'll just use a javascript to pick diferent background files for diferent resolutions.
at least people with 800x600 will only load a 90kb file instead of the big 800kb background.

thalamus
July 28th, 2007, 09:44 AM
Have you tried optimizing image with ImageReady or Fireworks? just a thought...