Jump to content

[SOLVED] need help


dezkit

Recommended Posts

how can i do so that anything below the image doesn't load until EVERYTHING loads.

 

<html>
<head>
</head>

<body onLoad="init()">
<div id="loading"><center><img src="loading.gif" border=0></center></div>
<script>
var ld=(document.all);

var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;

if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById("loading").style;
else if (ie4)
ld=document.all.loading.style;

function init()
{
if(ns4){ld.visibility="hidden";}
else if (ns6||ie4) ld.display="none";
}
</script>


<?php
$counter = 10;
while ( $counter <= 99999 ) {
echo $counter;
$counter = $counter + 1;
        echo "<br>";
}
?>

</body>
</html>

Link to comment
Share on other sites

;)  Not a /b/tard, don't worry.

 

Anyway, regarding to the original problem...Try:

 

<html>

<head>

</head>

 

<body>

<div id="loading" style="display:none;'">

<center><img src="loading.gif" border=0 onload="document.getElementById('loading').style.display= 'block';"></center>

</div>

</body>

</html>

Link to comment
Share on other sites

In place of that whole Javascript block and the current HTML.

 

<html>
<head>
</head>

<body>
<div id="loading" style="display:none;'">
<center><img src="loading.gif" border=0 onload="document.getElementById('loading').style.display= 'block';"></center>
</div>
<dib id="content">
<?php
$counter = 10;
while ( $counter <= 99999 ) {
echo $counter;
$counter = $counter + 1;
        echo "<br>";
}
?>
</div>
</body>
</html>

Link to comment
Share on other sites

well i am to tired to write the code out , but the logic is , have a set of tags (div for me) that have the image inside , and use JS to hide the rest of the page (that needs to be in tags, div) e.g.

 

 

<html>

<script type="text/javascript">

document.getElementById('main').style.visibility="hidden";

 

function loading()

{

document.getElementById("main").style.visibility="visible";

document.getElementById('loader').style.visibility="hidden";

document.getElementById('loader').style.marginTop="0%";

document.body.style.backgroundColor="#CCCCCC";

document.getElementById('loader').innerHTML = ' ';

}

 

</script>

<style type="text/css">

body

{

visibility:hidden;

background-color:#000000;

}

</style>

<body onLoad="loading()">

 

<div id="loader" align="center" class="test">

<h1>Loading</h1>

<br /><img src="loading.gif" alt="loading" align="absmiddle">

</div>

<div align="center" id="main">

Main stuff

</div>

</body>

</html>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.