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
https://forums.phpfreaks.com/topic/118173-solved-need-help/
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
https://forums.phpfreaks.com/topic/118173-solved-need-help/#findComment-608115
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
https://forums.phpfreaks.com/topic/118173-solved-need-help/#findComment-608123
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
https://forums.phpfreaks.com/topic/118173-solved-need-help/#findComment-608163
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.