PDA

View Full Version : Page loader script problem; not work in IE



rushiags
12-31-2008, 10:35 AM
Hello i am very new to this forum ,

I want to implement page loader functionality means while loading page first it load loader image and in background it can load total page and when page load properly the loader image is to invisible. and i am using the following code

<script>

window.onload=function()
{
document.getElementById('loading').style.visibility="hidden";
}
}
</script>




<body >
<div align="center" id="loading" style="position:absolute; height:100%; width:100%; text-align:center; top:0px; background-color:gray; opacity:0.6; filter:alpha(opacity=50); " >

<div style="top:300px; padding-top:300px; ">
<img src="<?=WEB_ROOT;?>/images/loading1.gif" align="center" border="0" style="background-color:#FFFFFF; ">
<br/>
<br/>
<p style="font-size:20px ">
<strong style="color:#FFFFFF ">Please Wait......Loading Results</strong>
</p>
</div>
</div>


</body>



This code is properly work in Firefox but not work in Internet Explorer.
Why???
If any changes that i have to make in code please send me....
Please any one can help me???????

magicyte
01-01-2009, 08:24 AM
Instead of 'script', try this tag:


<script type="text/javascript">
// loader here
</script>

That may work.

-magicyte

Nile
01-01-2009, 08:47 AM
window.onload=function()
{
document.getElementById('loading').style.visibility="hidden";
}
}

Remove the red part.

???
01-01-2009, 05:47 PM
Err, it's not wrong, but I noticed that in this:


<div align="center" id="loading" style="position:absolute; height:100%; width:100%; text-align:center; top:0px; background-color:gray; opacity:0.6; filter:alpha(opacity=50); " >
The transparency values for IE and FF aren't equivalent, so in IE they'll be slightly less visible. I doubt that's what you really want.
Also, I think you're supposed to use [code] tags for your code, no?

Stephen