gurpal5686 Posted May 19, 2010 Share Posted May 19, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.