...

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



chris_angell
07-30-2002, 05: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() {
loadingdiv.style.visibility="hidden";
}
-->


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



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 ???

:)

boxer_1
07-30-2002, 07: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 ;).

ShriekForth
07-30-2002, 07: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...


<SCRIPT LANGUAGE="JavaScript">
function fadeInPage() {
if (document.getElementById("loadingDiv").filters.alpha.opacity > 0){
document.getElementById("loadingDiv").filters.alpha.opacity -= 10;
eval('setTimeout("fadeInPage()",100)');
}
else{
document.getElementById('loadingDiv').style.visibility = "hidden"
}
}
</script>

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.

ShriekForth

chris_angell
07-30-2002, 09: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 :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum