Jump to content

javascript for on loading


gurpal5686

Recommended Posts

Hello

 

I am using the javascript to display the loading.gif image before the page load. But it is showing the both loading and other image at the same time.

 

 

<body onLoad="init()">

<div id="loading" style="width:100%; text-align:center; top:300px; "><img src="../images/loading.gif" /></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>

<center><img src="../images/ad1.jpeg"</center>

</body>

 

Please help me.

Link to comment
https://forums.phpfreaks.com/topic/202320-javascript-for-on-loading/
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.