View Full Version : show a div on load then hide when loaded. control the downloading of specific DIVS

07-30-2002, 06:58 PM
I am hoping to show a div when The page is loading, and once it has loaded this will fade away.. is it possible with the power of js + dom to do this... have a div with a 50 per alpha filter so you can see the page loading below but can't use any of the site until the div Hides after loading ????

the div will cover the screen.. with a grey tint :)

I have been thinking of doing it like this

function hideload() {

<body onLoad="hideload()">
<DIV ID="loadingDiv">

I think this is a bad way of doing it...... but I would like a 50 per filtered layer of one colour to go over the top of the page... then fades out when The page is loaded... plus text on this div.. I have been trying..

can you say: to open a specific division first the every thing casading below opens afterwards.. or control the way that division load ???


07-30-2002, 08:42 PM
Hi, something like this script (http://www.dhtmlcentral.com/script/script.asp?id=17)? Click "View script" to the left to see it in action, you might be able to get some ideas by looking throught he source. Good luck ;).

07-30-2002, 08:43 PM
Probably the best you could hope for is to put the loading div first, then a content div after. The browser would then render the first div, and it could sit there while it renders the rest of the page. This seems to work when I do a large select from a database and then form it into a large table. At wich point you could begin to fade it. Something like this...

function fadeInPage() {
if (document.getElementById("loadingDiv").filters.alpha.opacity > 0){
document.getElementById("loadingDiv").filters.alpha.opacity -= 10;
document.getElementById('loadingDiv').style.visibility = "hidden"

then onLoad call the fadeInPage to delay that you could setTimeout on load as well to give it half a second or soemthing before it starts to fade in. The final hidden bit will then allow the user to "click through" the loading tag.

The filter/apha bit is only supported in IE though.


07-30-2002, 10:18 PM
wow. it was perfect.. I am a happy man.. thank you

cheers ShriekForth...

you should be happy in the knowledge you are knowledgeable :)