Hey guys, not 100% sure if this JavaScript but,
I am trying to put a designed background onto my webpage, instead of just a plain color, and i am assuming that the only way to make it design like is to make the background a picture. And when i tried that before, for some reason when you click on the site, a white screen appears before the picture comes up ( I guess it's loading).
DO you guys have any suggestions on how I can go around doing this the "classy" way, or is there even a way to possibly have everything load before my webpage appears?
oh ok, thank you for the suggestion rnd,
quick question though, where would I place that code? In the css document next to where I have the code for the background image? or in the head section of the html document?
oh ok, thank you for the suggestion rnd,
quick question though, where would I place that code? In the css document next to where I have the code for the background image? or in the head section of the html document?
Thanks again
to do it "properly", it takes a bit more code.
you can place this code anywhere: head, body, in a script tag or in an external script...
to any of your stylesheets (the first one would be ideal), you can delete the dark green section of the code above.
I wanted to post something that could be cut and pasted anywhere, so i added the style manually with javascript instead of with CSS.
EDIT:
actually, i would not use the CSS posted above, use the whole script, alone.
if someone has javascript disabled, they wont be able to see your site at all!
but, if you use javascript to hide, it will never get hidden (or "shown").
EDIT:
re-reading the original post, i thought of something else.
you could do something else entirely, and make a full-screen "splash" div, that you hide when the page loads.
i use it to hold the progress bar on this javascript photo gallery demo page , and it's one way of keeping the user from clicking "Back", building suspense...
hey rnd,
if i have this: body {background-image: url("http://apod.nasa.gov/apod/image/0203/moon_gal_big.jpg"); }, in a separate css file....all i have to put in the html document in head or body is the:
rnd, i added the script into the head, that didnt seem to work and made everything dissapear, but now that I have it in the body everything is working normally.
The thing is i dont have my website connected to a host server yet so i can't fully tell if it works, I am waiting to finish it completely. But I have a lot of dynamic mumbojumbo and even music on it so i figure this will enable the entire website to load before the viewers can see it, and keeping it from looking glitchy. I will tell you how it goes once it's up and send you a link man.
Bookmarks